Skip to content

Commit 1cc3af6

Browse files
authored
Merge pull request #5809 from NlightNFotis/codecov_gh_actions_port
[CI] Port CMake Codecov job from Codebuild to Github Actions.
2 parents 23c11e8 + f02904e commit 1cc3af6

File tree

4 files changed

+33
-87
lines changed

4 files changed

+33
-87
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

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR
149149
"$<TARGET_FILE:jbmc>"
150150
"$<TARGET_FILE:jdiff>"
151151
"$<TARGET_FILE:smt2_solver>"
152+
"$<TARGET_FILE:symtab2gb>"
153+
"libour_archive.a"
152154
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
153155
)
154156
endif()

buildspec-linux-cmake-gcc-cov.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

buildspec-linux-make-gcc-cov.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)