From 887a046e7af4c84fb0388703bff6a9e9c06aaf75 Mon Sep 17 00:00:00 2001 From: PhilipDeegan Date: Sun, 7 Jun 2026 18:15:34 +0200 Subject: [PATCH] use meson in actions --- .github/workflows/ccpp.yml | 48 ++++++++++---------------------------- subprojects/yaml-cpp.wrap | 13 +++++++++++ tests/json/test.cpp | 4 ++-- tests/yaml/test.cpp | 2 +- 4 files changed, 28 insertions(+), 39 deletions(-) create mode 100644 subprojects/yaml-cpp.wrap diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 8d535d4..3237b9b 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -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 + diff --git a/subprojects/yaml-cpp.wrap b/subprojects/yaml-cpp.wrap new file mode 100644 index 0000000..d80dc7a --- /dev/null +++ b/subprojects/yaml-cpp.wrap @@ -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 diff --git a/tests/json/test.cpp b/tests/json/test.cpp index 04b1e11..04dc12c 100644 --- a/tests/json/test.cpp +++ b/tests/json/test.cpp @@ -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("") == "a string"); @@ -32,7 +32,7 @@ TEST_CASE("JSON to Dict", "[]") REQUIRE(config["section2"]["key_section2"].to("") == "value"); } -TEST_CASE("Dict to JSON", "[]") +TEST_CASE("Dict to JSON") { cppconfig::Config c; c["section1"] = 10; diff --git a/tests/yaml/test.cpp b/tests/yaml/test.cpp index 4d175eb..82c3a29 100644 --- a/tests/yaml/test.cpp +++ b/tests/yaml/test.cpp @@ -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("") == "a string");