test #1044
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: test | |
on: | |
push: | |
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@v7 | |
id: get-versions | |
with: | |
script: | | |
const minimalVersion = '1.41'; | |
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@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
cache: 'npm' | |
- run: npm ci | |
- run: > | |
npm install | |
@playwright/test@${{ matrix.playwrightVersion }} | |
@playwright/experimental-ct-react@${{ matrix.playwrightVersion }} | |
- run: npx playwright install --with-deps chromium | |
- run: npm test | |
- uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: test-results-${{ matrix.playwrightVersion }} | |
path: | | |
test/**/test-results/ | |
test/**/actual-reports/ | |
test/**/blob-report/ | |
test/**/.features-gen/ | |
retention-days: 1 | |
if-no-files-found: ignore |