Skip to content

Commit

Permalink
common: add coverage scan
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Michalski <jan.michalski@intel.com>
  • Loading branch information
janekmi committed Jul 20, 2023
1 parent 05f2041 commit f16d884
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/scan_coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Measure code coverage and report it to codecov.io
name: Coverage

on:
workflow_dispatch:
workflow_call:

env:
# Note: All coverage scans, e.g. on pull requests, should be run in the same
# environment.
GITHUB_REPO: pmem/pmdk
DOCKER_REPO: ghcr.io/pmem/pmdk
HOST_WORKDIR: /home/runner/work/pmdk/pmdk
WORKDIR: utils/docker
PMDK_CC: gcc
PMDK_CXX: g++
MAKE_PKG: 0
SRC_CHECKERS: 0
OS: ubuntu
OS_VER: 22.04
COVERAGE: 1
TEST_BUILD: debug
FAULT_INJECTION: 1

jobs:
linux:
name: Linux
runs-on: ubuntu-latest
steps:
- name: Clone the git repo
uses: actions/checkout@v3

- name: Pull the image
run: cd $WORKDIR && ./pull-or-rebuild-image.sh

- name: Measure and upload code coverage
run: cd $WORKDIR && ./build-CI.sh
3 changes: 3 additions & 0 deletions .github/workflows/scans.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ jobs:
COVERITY_SCAN_NOTIFICATION_EMAIL: ${{ secrets.COVERITY_SCAN_NOTIFICATION_EMAIL }}
COVERITY_SCAN_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
name: Coverity
call-coverage:
uses: ./.github/workflows/scan_coverage.yml
name: Coverage
call-documentation:
uses: ./.github/workflows/scan_documentation.yml
name: Documentation
2 changes: 2 additions & 0 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:
fail-fast: false
matrix:
include:
# Note: All coverage scans should be run in the same environment.
# Please see the coverage scan workflow for the reference environment.
- {TEST_BUILD: debug, COVERAGE: 1}
- {TEST_BUILD: nondebug, COVERAGE: 0}
steps:
Expand Down

0 comments on commit f16d884

Please sign in to comment.