chore(action): update codecov/codecov-action action to v5 #2931
Workflow file for this run
This file contains 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: Test | |
on: | |
push: | |
branches: | |
- isn-renovate/** # branches generated by https://github.com/apps/isn-renovate | |
pull_request: | |
branches: | |
- main | |
workflow_call: | |
secrets: | |
CODECOV_TOKEN: | |
required: true | |
jobs: | |
test_matrix: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
node-version: [18, 20, 21] | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout project | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
fetch-depth: 0 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: npm | |
- name: Install packages | |
run: npm ci | |
- name: Audit npm signatures | |
run: npm audit signatures | |
- name: Check codestyle compliance | |
run: npm run lint | |
- name: Run tests | |
run: npm run test | |
- name: Ensure commitlint works with our current config (push event) | |
if: github.event_name == 'push' | |
run: npx commitlint --from HEAD~1 --to HEAD --verbose | |
- name: Ensure commitlint works with our current config (pull_request event) | |
if: github.event_name == 'pull_request' | |
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose | |
- name: Upload coverage reports to Codecov | |
if: strategy.job-index == 0 | |
uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303 # v5.1.2 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: coverage/coverage-final.json | |
fail_ci_if_error: true | |
# separate job to set as required status check in branch protection | |
required_check: | |
runs-on: ubuntu-latest | |
needs: | |
- test_matrix | |
if: always() | |
steps: | |
- name: All required jobs and matrix versions passed | |
if: ${{ !(contains(needs.*.result, 'failure')) }} | |
run: exit 0 | |
- name: Some required jobs or matrix versions failed | |
if: ${{ contains(needs.*.result, 'failure') }} | |
run: exit 1 |