From fa26ab1077632720920f138933e2906843339df4 Mon Sep 17 00:00:00 2001 From: Dusan Figala Date: Fri, 31 Mar 2023 13:50:07 +0200 Subject: [PATCH] Add code coverage CI job --- .github/workflows/ci.yml | 9 +++++++++ .github/workflows/reusable-ci.yml | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 99f2ffff4..7b347d5b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,3 +73,12 @@ jobs: repository: private-downstream-ci event_type: downstream-ci-hpc payload: '{"eccodes": "ecmwf/eccodes@${{ github.event.pull_request.head.sha || github.sha }}"}' + + codecov: + name: code-coverage + if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }} + uses: ./.github/workflows/reusable-ci.yml + with: + eccodes: ecmwf/eccodes@${{ github.event.pull_request.head.sha || github.sha }} + codecov: true + secrets: inherit diff --git a/.github/workflows/reusable-ci.yml b/.github/workflows/reusable-ci.yml index 79f4cf53b..25cc1765e 100644 --- a/.github/workflows/reusable-ci.yml +++ b/.github/workflows/reusable-ci.yml @@ -6,6 +6,10 @@ on: eccodes: required: false type: string + codecov: + required: false + type: boolean + default: false jobs: ci: @@ -14,6 +18,7 @@ jobs: with: repository: ${{ inputs.eccodes || 'ecmwf/eccodes@develop' }} name_prefix: eccodes- + codecov_upload: ${{ inputs.codecov }} build_package_inputs: | repository: ${{ inputs.eccodes || 'ecmwf/eccodes@develop' }} self_coverage: true