Fix CI builds with ubuntu-latest (#10) #157
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: pasta::bit_vector CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest] | |
| version: [11, 12, 13] | |
| name: Build (GCC ${{ matrix.version }}) | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| with: | |
| submodules: true | |
| - name: Prepare build environment | |
| run: | | |
| sudo apt update | |
| sudo apt-get install ninja-build gcovr cmake gcc-${{ matrix.version }} g++-${{ matrix.version }} | |
| sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ matrix.version }} ${{ matrix.version }} | |
| sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${{ matrix.version }} ${{ matrix.version }} | |
| - name: Configure CMake | |
| run: cmake --preset=debug -DPASTA_BIT_VECTOR_BUILD_TESTS=On -DPASTA_BIT_VECTOR_COVERAGE_REPORTING=On | |
| - name: Build | |
| run: cmake --build ${{github.workspace}}/debug/ | |
| - name: Test | |
| run: ctest --output-on-failure --test-dir ${{github.workspace}}/debug/ | |
| - name: Run gcovr | |
| run: | | |
| mkdir ${{github.workspace}}/coverage | |
| gcovr -r . -e extlib/ -e tests/ --xml-pretty | tee ${{github.workspace}}/coverage/coverage.xml | |
| - name: Upload Coverage | |
| uses: codecov/codecov-action@v2 | |
| with: | |
| token: ${{ secrets.CODECOV_SECRET }} | |
| files: ${{github.workspace}}/coverage/coverage.xml |