Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 12 additions & 36 deletions .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,58 +2,34 @@ name: C/C++ CI

on:
push:
branches: [ master ]
branches: [ main ]
pull_request:
branches: [ master ]
branches: [ main ]

jobs:
gcc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Configure with CMake
run: cmake -DBUILD_TEST:bool=ON -S . -B build_cmake
- name: Build (CMake)
run: cmake --build build_cmake
- name: Run tests (CMake)
run: cd build_cmake && ctest && cd ..
- name: update Meson
run: python3 -m pip install meson -U
- name: Configure with Meson
run: meson . build
- name: Build (meson)
run: ninja -C build
- name: Run tests (meson)
run: ninja test -C build

clang:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Configure with CMake
run: cmake -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DBUILD_TEST:bool=ON -S . -B build_cmake
- name: Build (CMake)
run: cmake --build build_cmake
- name: Run tests (CMake)
run: cd build_cmake && ctest && cd ..

coverage:
runs-on: ubuntu-latest
container: jeandet/simple_cxx_fedora
steps:
- uses: actions/checkout@v6
- name: update Meson
run: python3 -m pip install meson -U
- name: Configure with Meson
run: meson -Db_coverage=true . build
run: CC=clang CXX=clang++ meson . build
- name: Build (meson)
run: ninja -C build
- name: Run tests (meson)
run: ninja test -C build
- name: Generate Coverage repport
run: |
lcov --capture --directory . --output-file coverage.info
lcov --remove coverage.info '/usr/*' --output-file coverage.info
lcov --remove coverage.info '*/catch.hpp' --output-file coverage.info
lcov --list coverage.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.info
flags: unittests
name: codecov-cdfpp
yml: ./codecov.yml
fail_ci_if_error: true

13 changes: 13 additions & 0 deletions subprojects/yaml-cpp.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[wrap-file]
directory = yaml-cpp-0.8.0
source_url = https://github.com/jbeder/yaml-cpp/archive/refs/tags/0.8.0.zip
source_filename = yaml-cpp-0.8.0.zip
source_hash = 334e80ab7b52e14c23f94e041c74bab0742f2281aad55f66be2f19f4b7747071
source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/yaml-cpp_0.8.0-2/yaml-cpp-0.8.0.zip
patch_filename = yaml-cpp_0.8.0-2_patch.zip
patch_url = https://wrapdb.mesonbuild.com/v2/yaml-cpp_0.8.0-2/get_patch
patch_hash = e7424f2804f2bb9e99f8ecea0c3c53e6de813f93043130243a27adfef3526573
wrapdb_version = 0.8.0-2

[provide]
dependency_names = yaml-cpp
4 changes: 2 additions & 2 deletions tests/json/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const auto JSON = std::string(R"(
}
)");

TEST_CASE("JSON to Dict", "[]")
TEST_CASE("JSON to Dict")
{
auto config = cppconfig::from_json(JSON);
REQUIRE(config["section1"]["key_string"].to<std::string>("") == "a string");
Expand All @@ -32,7 +32,7 @@ TEST_CASE("JSON to Dict", "[]")
REQUIRE(config["section2"]["key_section2"].to<std::string>("") == "value");
}

TEST_CASE("Dict to JSON", "[]")
TEST_CASE("Dict to JSON")
{
cppconfig::Config c;
c["section1"] = 10;
Expand Down
2 changes: 1 addition & 1 deletion tests/yaml/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const auto YML = std::string(R"(
key_section2: value
)");

TEST_CASE("YAML to Dict", "[]")
TEST_CASE("YAML to Dict")
{
auto config = cppconfig::from_yaml(YML);
REQUIRE(config["section1"]["key_string"].to<std::string>("") == "a string");
Expand Down