Skip to content

Commit 1e18a11

Browse files
committed
Port CMake Codecov job from Codebuild to Github Actions.
This is part of our streamlining and cleanup of our CI infrastructure.
1 parent 3cb60fc commit 1e18a11

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/pull-request-checks.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,3 +385,34 @@ jobs:
385385
docker run -v ${PWD}/.github/workflows/smoke_test_assets:/mnt/smoke -t cbmc jbmc --classpath /mnt/smoke Test
386386
- name: Smoke test goto-analyzer
387387
run: docker run -v ${PWD}/.github/workflows/smoke_test_assets:/mnt/smoke -t cbmc goto-analyzer /mnt/smoke/test.goto --unreachable-functions
388+
389+
codecov-coverage-report:
390+
runs-on: ubuntu-20.04
391+
steps:
392+
- name: Clone repository
393+
uses: actions/checkout@v2
394+
with:
395+
submodules: recursive
396+
- name: Download testing and coverage dependencies
397+
env:
398+
# This is needed in addition to -yq to prevent apt-get from asking for
399+
# user input
400+
DEBIAN_FRONTEND: noninteractive
401+
run: |
402+
sudo apt-get update
403+
sudo apt-get install --no-install-recommends -y g++ gcc binutils flex bison cmake maven jq libxml2-utils openjdk-11-jdk-headless lcov
404+
- name: Configure CMake CBMC build with coverage instrumentation parameters
405+
run: cmake -S . -Bbuild -Denable_coverage=1 -Dparallel_tests=2 -DCMAKE_CXX_COMPILER=/usr/bin/g++
406+
- name: Execute CMake CBMC build
407+
run: cmake --build build --target coverage -- -j2
408+
- name: Collect coverage statistics
409+
run: |
410+
lcov --capture --directory build --output-file lcov.info
411+
lcov --remove lcov.info '/usr/*' --output-file lcov.info
412+
- name: Upload coverage statistics to Codecov
413+
uses: codecov/codecov-action@v1
414+
with:
415+
token: ${{ secrets.CODECOV_TOKEN }}
416+
files: ./lcov.info
417+
fail_ci_if_error: true
418+
verbose: true

0 commit comments

Comments
 (0)