Playwright - GitHub Actions
Running Playwright in Parallel on GitHub Actions using Matrix Workflow
name: demo.playwright.pwc
on:
workflow_dispatch:
pull_request:
branches: [main]
push:
branches: [main]
jobs:
basicTests:
strategy:
fail-fast: false
matrix:
# run 3 copies of the current job in parallel
shard: [1, 2, 3]
name: "Playwright tests"
timeout-minutes: 60
runs-on: ubuntu-22.04
container: mcr.microsoft.com/playwright:latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
# https://github.com/actions/runner-images/issues/6775
- run: |
echo "$GITHUB_WORKSPACE"
git config --global --add safe.directory "$GITHUB_WORKSPACE"
- uses: actions/setup-node@v3
with:
node-version: "18.x"
- name: Install dependencies
run: |
npm ci
npx playwright install msedge
npx playwright install chrome
# Grab
# - CURRENTS_PROJECT_ID
# - CURRENTS_RECORD_KEY
# at https://app.currents.dev
#
# Read more about CI Build ID:
# https://currents.dev/readme/guides/cypress-ci-build-id
- name: Run Basic Tests
continue-on-error: false
working-directory: ./basic
env:
CURRENTS_PROJECT_ID: 3BwCwz
CURRENTS_RECORD_KEY: ${{ secrets.CURRENTS_RECORD_KEY }}
run: |
npx playwright install
npx pwc --shard=${{ matrix.shard }}/${{ strategy.job-total }} --ci-build-id "${{ github.repository }}-${{ github.run_id }}-${{ github.run_attempt }}"
Last updated
Was this helpful?