Refactor for a more modern API #110
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: trx-cpp tests | |
| on: | |
| pull_request: | |
| paths: | |
| - "**" | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y software-properties-common | |
| sudo add-apt-repository universe | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| cmake \ | |
| g++ \ | |
| lcov \ | |
| zlib1g-dev \ | |
| libeigen3-dev \ | |
| libzip-dev \ | |
| zipcmp \ | |
| zipmerge \ | |
| ziptool \ | |
| ninja-build | |
| - name: Build and install GoogleTest | |
| run: | | |
| git clone --depth 1 https://github.com/google/googletest.git deps/googletest | |
| cmake -S deps/googletest -B deps/googletest/build \ | |
| -G Ninja \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/deps/googletest/install | |
| cmake --build deps/googletest/build --target install | |
| - name: Configure trx-cpp | |
| run: | | |
| cmake -S . -B build \ | |
| -G Ninja \ | |
| -DTRX_BUILD_TESTS=ON \ | |
| -DTRX_BUILD_EXAMPLES=ON \ | |
| -DTRX_ENABLE_NIFTI=ON \ | |
| -DGTest_DIR=${GITHUB_WORKSPACE}/deps/googletest/install/lib/cmake/GTest \ | |
| -DCMAKE_BUILD_TYPE=Debug \ | |
| -DCMAKE_C_FLAGS="--coverage" \ | |
| -DCMAKE_CXX_FLAGS="--coverage" | |
| - name: Build | |
| run: cmake --build build | |
| - name: Test | |
| run: ctest --test-dir build --output-on-failure | |
| - name: Generate coverage summary | |
| run: | | |
| lcov --capture --directory build \ | |
| --rc geninfo_unexecuted_blocks=1 \ | |
| --ignore-errors mismatch \ | |
| --output-file coverage.info | |
| lcov --summary coverage.info | |
| - name: Upload to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: coverage.info | |
| flags: linux | |
| fail_ci_if_error: true | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Upload coverage report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: trx-cpp-coverage | |
| path: coverage.info | |
| conan-create: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install build tooling | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y cmake ninja-build g++ | |
| - name: Install Conan | |
| run: | | |
| python3 -m pip install --upgrade pip | |
| python3 -m pip install "conan>=2.0,<3.0" | |
| - name: Conan create (with tests) | |
| env: | |
| CONAN_HOME: ${{ runner.temp }}/.conan2 | |
| run: | | |
| conan profile detect --force | |
| conan create . --build=missing -o with_tests=True -s build_type=Release |