Files
MapLibreParticleLab/.github/workflows/upload-coverage.yml
dependabot[bot] 5642b1ffa4 Bump codecov/codecov-action from 3 to 5 in the github-actions group (#3026)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-19 12:59:55 +01:00

43 lines
1.3 KiB
YAML

name: upload-coverage
on:
workflow_run:
workflows: [linux-ci]
types:
- completed
jobs:
pre_job:
runs-on: ubuntu-latest
outputs:
should_run: ${{ steps.check_skip.outputs.should_run }}
steps:
- id: check_skip
run: |
conclusion=$(curl ${{ github.event.workflow_run.jobs_url }} | jq -r '.jobs[] | select(.name == "linux-coverage").conclusion')
should_run=$([[ "$conclusion" = "success" ]] && echo "true" || echo "false")
echo "should_run=$should_run" >> "$GITHUB_OUTPUT"
upload-coverage:
needs: pre_job
if: needs.pre_job.outputs.should_run == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/download-workflow-run-artifact
with:
artifact-name: coverage-report
expect-files: "_coverage_report.dat"
- name: Upload coverage report
if: '!cancelled()'
uses: codecov/codecov-action@v5
with:
override_commit: ${{ github.event.workflow_run.head_sha }}
override_pr: ${{ github.event.workflow_run.pull_requests[0].number }}
token: ${{ secrets.CODECOV_TOKEN }}
files: "_coverage_report.dat"
fail_ci_if_error: true
verbose: true