Skip to content

Makes changes

Makes changes #49

Workflow file for this run

name: Test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake g++ libgtest-dev lcov
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Debug
- name: Build
run: cmake --build ${{github.workspace}}/build --config Debug
- name: Run tests
working-directory: ${{github.workspace}}/build
run: ctest --output-on-failure
id: run_tests
- name: Generate coverage report
if: always()
working-directory: ${{github.workspace}}/build
run: |
./tests/test_all || true
lcov --capture --directory . --output-file coverage.info
lcov --remove coverage.info '/usr/*' '*/tests/*' --output-file coverage.info
lcov --list coverage.info
- name: Upload coverage report as artifact
if: always()
uses: actions/upload-artifact@v2
with:
name: coverage-report
path: ${{github.workspace}}/build/coverage.info
- name: Upload coverage to Codecov
if: success()
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true