Skip to content

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

  1. Go to your repository's Settings > Secrets and variables > Actions
  2. Add a new secret named DRAPE_API_KEY with your Drape API key

Next Steps