[WIP] Refactor sparse drivers #271
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
| on: ["push", "pull_request"] | |
| name: Test Coverage | |
| jobs: | |
| run-coverage: | |
| name: Build | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install gcc-13 g++-13 for c++20 | |
| run: | # get gcc-13 on 22.04 | |
| sudo apt update | |
| sudo apt install -y software-properties-common | |
| sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test | |
| sudo apt update | |
| sudo apt install -y gcc-13 g++-13 | |
| echo "CXX=g++-13" >> $GITHUB_ENV | |
| echo "CC=gcc-13" >> $GITHUB_ENV | |
| - name: Install lcov | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y lcov | |
| - name: Install Boost | |
| shell: bash | |
| run: | | |
| sudo apt-get install libboost-all-dev | |
| - name: Configure and build ADOL-C | |
| run: | | |
| mkdir build | |
| cd build | |
| cmake \ | |
| -DCMAKE_CXX_COMPILER=g++-13 \ | |
| -DCMAKE_C_COMPILER=gcc-13 \ | |
| -DCMAKE_BUILD_TYPE=Debug \ | |
| -DBUILD_TESTS_WITH_COV=ON \ | |
| -DENABLE_SPARSE=1 \ | |
| -S .. \ | |
| -B . | |
| cmake --build . | |
| - name: Run Tests | |
| run: | | |
| set +e # otherwise the coverage report fails if ctest finds errors | |
| ctest --test-dir build/ | |
| exit 0 | |
| # Capture coverage data | |
| - name: Generate coverage report | |
| run: | | |
| cd build | |
| lcov --gcov-tool $(which gcov-13) --capture --directory . --output-file coverage.info | |
| lcov --remove coverage.info '/usr/*' 'boost/*' 'c++11/*' '/home/runner/work/ADOL-C/ADOL-C/ADOL-C/boost-test/*' --output-file coverage.info | |
| lcov --list coverage.info | |
| # Upload coverage report to Codecov | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: build/coverage.info | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| flags: unittests | |
| name: code-coverage-report |