Skip to content

Extend CodeCov operations in CI #1

Extend CodeCov operations in CI

Extend CodeCov operations in CI #1

Workflow file for this run

---
name: codecov
on:
workflow_call:
secrets:
GITHUB_TOKEN:

Check failure on line 6 in .github/workflows/_codecov.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/_codecov.yml

Invalid workflow file

secret name `GITHUB_TOKEN` within `workflow_call` can not be used since it would collide with system reserved name
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 }}