Skip to content

[CI] Upload PR coverage #754

[CI] Upload PR coverage

[CI] Upload PR coverage #754

name: "[CI] Upload PR coverage"
on:
workflow_run:
workflows:
- \[CI\] Test PR
types:
- completed
jobs:
upload-coverage:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Download All Artifacts
uses: actions/download-artifact@v4
with:
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GH_PAT }}
merge-multiple: true
- name: Read PR
uses: actions/github-script@v7
id: set-pr
with:
script: |
var fs = require('fs');
return Number(fs.readFileSync('./NR'));
result-encoding: string
- uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_sha }}
path: repo_clone
- name: Upload coverage report
if: "!cancelled()"
uses: codecov/codecov-action@v3
with:
override_commit: ${{ github.event.workflow_run.head_sha }}
override_pr: ${{steps.set-pr.outputs.result}}
token: ${{ secrets.CODECOV_TOKEN }}
files: "${{ github.workspace}}/coverage-3.8.xml,${{ github.workspace}}/coverage-3.9.xml,${{ github.workspace}}/coverage-3.10.xml,${{ github.workspace}}/coverage-3.11.xml,${{ github.workspace}}/coverage-3.12.xml"
fail_ci_if_error: true
verbose: true
root_dir: ${{ github.workspace }}/repo_clone