Run tests with coverage comparison against the main branch.
Downloads the main branch's coverage artifact, runs the current PR's tests, calculates the delta, and posts a formatted report on the PR.
name: Integration
on:
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: elpic/actions/integration/python/test@v1 - uses: elpic/actions/integration/python/test@v1
with:
setup: node
node-version: '22'
test-coverage-task: test:coverage - uses: elpic/actions/integration/python/test@v1
with:
setup: just
test-coverage-task: test:coverage| Input | Required | Default | Description |
|---|---|---|---|
setup |
no | bash |
Tool setup method -- bash, mise, node, just, or none |
node-version |
no | 20 |
Node.js version (used when setup=node) |
test-coverage-task |
no | test:coverage |
Task that runs tests with coverage (produces coverage.xml) |
test-task |
no | test |
Task that runs tests without coverage |
timeout-minutes |
no | 8 |
Step timeout |
Your project needs a task named test:coverage that produces coverage.xml. Coverage from the main branch is downloaded via gh run download and compared against the current PR.