To set up a TypeScript-based project using Playwright for end-to-end tests that are run via GitHub Actions, copy api-reporter.ts to .github/workflows/lib/api-reporter.ts and reference in your playwright.config.ts file:
export default defineConfig({
...
reporter: [
['./.github/workflows/lib/api-reporter.ts'],
...
})then provide the necessary environment variables in your .github/workflows/e2e.yml file:
jobs:
test:
...
- run: npm run e2e
env:
TAB_API_URL: ${{ vars.TAB_API_URL }}
TAB_API_KEY: ${{ secrets.TAB_API_KEY }}
CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
CI_PR_NUMBER: ${{ github.event.pull_request.number }}To set up a Rust-based project using Nextest for unit tests that are run via GitHub Actions, copy upload-results.sh to .github/workflows/lib/upload-results.sh and call that from your .github/workflows/unit.yml file:
jobs:
test:
...
- name: Run tests
run: |
cargo nextest run --profile=ci || true # let TAB determine failure
.github/workflows/lib/upload-results.sh
env:
TAB_API_URL: ${{ vars.TAB_API_URL }}
TAB_API_KEY: ${{ secrets.TAB_API_KEY }}
CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
CI_PR_NUMBER: ${{ github.event.pull_request.number }}and configure the JUnit XML reporter in your nextest.toml file:
[profile.ci.junit]
path = "./test-results/junit.xml"