diff --git a/.github/workflows/scan_coverage.yml b/.github/workflows/scan_coverage.yml new file mode 100644 index 00000000000..e0381be0c13 --- /dev/null +++ b/.github/workflows/scan_coverage.yml @@ -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 diff --git a/.github/workflows/scans.yml b/.github/workflows/scans.yml index 6f19a4f66a6..fe8174e6152 100644 --- a/.github/workflows/scans.yml +++ b/.github/workflows/scans.yml @@ -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 diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 57649d57b19..695d4a996a4 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -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: