Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update coverage github action #5483

Merged
merged 1 commit into from
Aug 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 20 additions & 10 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@ on:
schedule:
- cron: "0 11 * * *"

env:
BUILD_TYPE: Debug
CMAKE_GENERATOR: Ninja

jobs:
build:
runs-on: ubuntu-latest

env:
CC: clang
CXX: clang++
BUILD_TYPE: Debug
CMAKE_GENERATOR: Ninja
COV_DETAILS_PATH: ${{github.workspace}}/cov-details

steps:
- uses: actions/checkout@v2
Expand All @@ -25,14 +24,13 @@ jobs:
run: |
sudo apt-get remove -y --purge man-db
sudo apt-get update -y
sudo apt-get install -y gcovr ninja-build
sudo apt-get install -y gcovr ninja-build llvm clang

## Building
- name: Configure CMake Z3
run: CFLAGS=="--coverage" CXXFLAGS="--coverage" LDFLAGS="-lgcov" cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=./install

- name: Build Z3
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --target install --config ${{env.BUILD_TYPE}}

- name: Build test-z3
Expand Down Expand Up @@ -75,8 +73,14 @@ jobs:
- name: Gather coverage
run: |
cd ${{github.workspace}}
gcovr
#gcovr --html -o coverage.html .
gcovr --html coverage.html --gcov-executable "llvm-cov gcov" .
cd -

- name: Gather detailed coverage
run: |
cd ${{github.workspace}}
mkdir cov-details
gcovr --html-details ${{env.COV_DETAILS_PATH}}/coverage.html --gcov-executable "llvm-cov gcov" -r `pwd`/src --object-directory `pwd`/build
cd -

- name: Get date
Expand All @@ -86,5 +90,11 @@ jobs:
- uses: actions/upload-artifact@v2
with:
name: coverage-${{steps.date.outputs.date}}
path: coverage.html
retention-days: 10
path: ${{github.workspace}}/coverage.html
retention-days: 4

- uses: actions/upload-artifact@v2
with:
name: coverage-details-${{steps.date.outputs.date}}
path: ${{env.COV_DETAILS_PATH}}
retention-days: 4