GitHub Action Setup¶
The official Drape GitHub Action uploads results and posts rich PR comments automatically.
Basic Setup¶
Add this to your workflow file (e.g., .github/workflows/ci.yml):
name: CI
on: [push, pull_request]
permissions:
contents: read
pull-requests: write
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run tests
run: pytest --junitxml=results.xml --cov --cov-report=xml:coverage.xml
continue-on-error: true
- name: Upload test results
uses: drape-io/drape-action@v2
if: always()
continue-on-error: true
with:
command: tests
file: results.xml
api-key: ${{ secrets.DRAPE_API_KEY }}
- name: Upload coverage
uses: drape-io/drape-action@v2
if: always()
continue-on-error: true
with:
command: coverage
file: coverage.xml
format: cobertura
api-key: ${{ secrets.DRAPE_API_KEY }}
What You Get¶
The action automatically:
- Uploads results to Drape for processing
- Posts PR comments with test summaries, coverage diffs, and suppression status
- Detects CI context (branch, SHA, PR number) from the GitHub Actions environment
Store Your API Key¶
- Go to your repository's Settings > Secrets and variables > Actions
- Add a new secret named
DRAPE_API_KEYwith your Drape API key
Next Steps¶
- GitHub Action reference for all inputs, outputs, and advanced configuration.
- Security scans and lint reports can also be uploaded via the action.