Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Upload coverage to Codecov

on:
workflow_run:
workflows: ["test"]
types: [completed]

permissions: {}

jobs:
upload:
runs-on: ubuntu-24.04
if: github.event.workflow_run.conclusion == 'success'
permissions: {}
steps:
- name: Download coverage artifacts
uses: actions/download-artifact@v4
with:
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ github.token }}
path: coverage
- name: Upload to Codecov
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
files: >-
coverage/playwright-coverage/codecov.json,
coverage/test-coverage/codecov.json
token: ${{ secrets.CODECOV_TOKEN }}
override_commit: ${{ github.event.workflow_run.head_sha }}
override_pr: ${{ github.event.workflow_run.pull_requests[0].number }}
22 changes: 16 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,15 @@ jobs:
sudo: true
- name: Generate Codecov report
run: cover -report codecovbash
- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: playwright-coverage
path: ./cover_db/codecov.json
- uses: codecov/codecov-action@v5
if: secrets.CODECOV_TOKEN != ''
with:
fail_ci_if_error: true
fail_ci_if_error: false
file: ./cover_db/codecov.json
token: ${{ secrets.CODECOV_TOKEN }}
test:
Expand All @@ -140,9 +146,7 @@ jobs:
steps:
- name: Enable coverage
id: coverage
if: >
matrix.resolver == 'snapshot'
&& github.event.pull_request.user.login != 'dependabot[bot]'
if: matrix.resolver == 'snapshot'
run: echo "enabled=1" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
Expand Down Expand Up @@ -180,9 +184,15 @@ jobs:
- name: Generate Codecov report
if: steps.coverage.outputs.enabled
run: cover -report codecovbash
- uses: codecov/codecov-action@v5
- name: Upload coverage artifact
if: steps.coverage.outputs.enabled
uses: actions/upload-artifact@v4
with:
name: test-coverage
path: ./cover_db/codecov.json
- uses: codecov/codecov-action@v5
if: steps.coverage.outputs.enabled && secrets.CODECOV_TOKEN != ''
with:
fail_ci_if_error: true
fail_ci_if_error: false
file: ./cover_db/codecov.json
token: ${{ secrets.CODECOV_TOKEN }}