Extend CodeCov operations in CI #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | ||
name: codecov | ||
on: | ||
workflow_call: | ||
secrets: | ||
GITHUB_TOKEN: | ||
required: true | ||
description: Token to post comments on the PR. | ||
CODECOV_TOKEN: | ||
required: true | ||
description: Token to upload reports to Codecov. | ||
inputs: | ||
post_comment: | ||
description: 'Set to true to post a test summary comment on the PR.' | ||
type: boolean | ||
required: true | ||
default: false | ||
upload_report: | ||
description: 'Set to true to upload test reports to Codecov.' | ||
type: boolean | ||
required: true | ||
default: false | ||
report-name: | ||
description: 'Name to use when uploading reports to Codecov.' | ||
type: string | ||
required: true | ||
default: 'CI Test Results' | ||
jobs: | ||
report_summary: | ||
name: Aggregate test results | ||
runs-on: ubuntu-4 | ||
permissions: | ||
pull-requests: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v5 | ||
- name: Download Go JUnit reports | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: go-junit-reports | ||
path: downloaded-reports/go | ||
- name: Download Rust JUnit reports | ||
uses: actions/download-artifact@v4 | ||
continue-on-error: true # Rust pipeline might have not been run | ||
with: | ||
name: rust-junit-reports | ||
path: downloaded-reports/rust | ||
- name: Post test summary comment | ||
if: ${{ inputs.post_comment }} | ||
uses: codecov/basic-test-results@v1 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
directory: 'downloaded-reports/' | ||
- name: Upload test results to Codecov | ||
if: ${{ inputs.upload_report }} | ||
uses: codecov/test-results-action@v1 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
directory: 'downloaded-reports/' | ||
name: ${{ inputs.report-name }} |