Skip to content

test

test #792

Workflow file for this run

name: test
env:
MIN_PLAYWRIGHT_VERSION: 1.53.0
on:
push:
branches: ['**']
paths-ignore:
- 'example/**'
- '**/*.md'
pull_request:
branches: [main, beta]
schedule:
# run daily at 00:00
- cron: 0 0 * * *
jobs:
get-playwright-versions:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v9
id: get-versions
with:
script: |
if (context.eventName === 'schedule') return [ 'beta' ];
const minimalVersion = process.env.MIN_PLAYWRIGHT_VERSION;
const { execSync } = require('node:child_process');
const info = execSync('npm show --json @playwright/test').toString();
const { versions } = JSON.parse(info);
return versions
.filter((v) => v.match(/\.0$/) && v >= minimalVersion)
.map((v) => v.replace(/\.0$/, ''))
.concat([ 'beta' ]);
outputs:
versions: ${{ steps.get-versions.outputs.result }}
test:
needs: get-playwright-versions
runs-on: ubuntu-22.04
strategy:
matrix:
playwrightVersion: ${{ fromJson(needs.get-playwright-versions.outputs.versions) }}
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 24
cache: 'npm'
- run: npm ci
- run: npm install --min-release-age=0 @playwright/test@${{ matrix.playwrightVersion }}
- run: npx playwright install --with-deps chromium
- run: npm run e2e