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