-
-
Notifications
You must be signed in to change notification settings - Fork 42
80 lines (75 loc) · 2.32 KB
/
test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
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@v6
id: get-versions
with:
script: |
const minimalVersion = '1.34';
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$/, ''));
outputs:
versions: ${{ steps.get-versions.outputs.result }}
test:
needs: get-playwright-versions
runs-on: ubuntu-latest
strategy:
matrix:
playwrightVersion: ${{ fromJson(needs.get-playwright-versions.outputs.versions) }}
cucumberVersion: ['9']
include:
# there were breaking changes in cucumber 10.x -> test on 10.0 and 10.1
- playwrightVersion: '1.37'
cucumberVersion: '10.0'
- playwrightVersion: '1.38'
cucumberVersion: '10.1'
- playwrightVersion: '1.39'
cucumberVersion: '10'
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 }}
@cucumber/cucumber@${{ matrix.cucumberVersion }}
- run: npx playwright install --with-deps chromium
- run: npm test
- uses: actions/upload-artifact@v3
if: always()
with:
name: test-results
path: test/**/test-results/
retention-days: 10
if-no-files-found: ignore
examples:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node-version: [16, 18, 20]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npx playwright install --with-deps chromium
- run: npm run examples