Guides
CI Examples
Guides
CI Examples
Learn how to run tests and publish report in CI/CD
Github Actions
.github/workflows/inspecter.yml
name: Inspecter Tests
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
# Adding permissions to GITHUB_TOKEN to comment on PRs
permissions:
pull-requests: write # Necessary to comment on PRs
contents: read # Necessary for actions/checkout step
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Install Browser
run: npx playwright install --with-deps chromium
- name: Run tests
run: npx inspecter run
- name: Build report
run: npx inspecter build-report
- name: Publish report
run: |
# TODO: Implement logic to publish report to S3 or Github Pages
echo "REPORT_URL=(Add report URL here)" >> $GITHUB_ENV
- name: Comment Github
env:
GITHUB_TOKEN: ${{ github.token }}
run: npx inspecter comment-github --report-url $REPORT_URL --minimize
On this page