name: Build on: push: branches: - main paths-ignore: - '.github/**' - '!.github/workflows/**' pull_request: paths-ignore: - '.github/**' - '!.github/workflows/**' - 'README.md' jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 with: fetch-depth: 0 submodules: recursive - name: Install Dependencies run: sudo apt-get update && sudo apt-get install -yq libboost-test-dev - name: Build run: | mkdir build cmake -Bbuild -S. cmake --build build/ --target all ls build - name: Test run: ctest --test-dir build --output-on-failure coverage: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 with: submodules: recursive - name: Install Dependencies run: | sudo apt-get update && sudo apt-get install -yq libboost-test-dev pipx install gcovr==8.2 - name: Build with coverage instrumentation run: | cmake -Bbuild -S. \ -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_C_FLAGS="--coverage" \ -DCMAKE_CXX_FLAGS="--coverage" \ -DCMAKE_EXE_LINKER_FLAGS="--coverage" cmake --build build/ --target all - name: Run tests run: ctest --test-dir build --output-on-failure - name: Generate coverage report run: | mkdir -p coverage gcovr --root . --filter src/ build/ \ --txt coverage/summary.txt \ --html-details coverage/index.html \ --cobertura coverage/cobertura.xml \ --print-summary { echo '## Coverage' echo '```' cat coverage/summary.txt echo '```' } >> "$GITHUB_STEP_SUMMARY" - name: Upload coverage report uses: actions/upload-artifact@v7 with: name: coverage-report path: coverage/