GitHub Actions
Run Assrt tests on every push or pull request with GitHub Actions. The recipe below installs the CLI, caches browser binaries between runs, executes the suite, and uploads results as an artifact.
Minimal workflow
.github/workflows/assrt.ymlyaml
name: Assrt
on:
push:
branches: [main]
pull_request:
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- run: npx assrt install-browsers
- run: npx assrt run --reporter junit
env:
TEST_PASSWORD: ${{ secrets.TEST_PASSWORD }}
- name: Upload results
if: always()
uses: actions/upload-artifact@v4
with:
name: assrt-results
path: assrt-results/Triggering Cloud runs instead
If you want CI to kick tests off but execute them on managed browsers, swap the run step for a Cloud trigger.
yaml
- run: npx assrt run --cloud --wait
env:
ASSRT_TOKEN: ${{ secrets.ASSRT_TOKEN }}Matrix by browser
Add a
strategy.matrix on browser to run the same suite against Chromium, Firefox, and WebKit in parallel.Checklist
- Store credentials and API tokens as repo or org secrets, not in the workflow.
- Pin
actions/*to a major version and Node to an LTS release. - Upload the results directory unconditionally so failures are debuggable.