Skip to content

Commit 700ca07

Browse files
committed
Create qa-run.yml
1 parent dd7fa07 commit 700ca07

1 file changed

Lines changed: 81 additions & 0 deletions

File tree

.github/workflows/qa-run.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: QA Run
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
path_prefix:
7+
description: 'Path prefix to test (e.g. /experience-cloud/cloud-manager)'
8+
required: true
9+
type: string
10+
suite:
11+
description: 'Test suite to run'
12+
required: false
13+
default: 'all'
14+
type: choice
15+
options:
16+
- all
17+
- visual
18+
- links
19+
- nav
20+
- images
21+
- content
22+
threshold:
23+
description: 'Visual diff threshold %'
24+
required: false
25+
default: '5'
26+
type: string
27+
28+
permissions:
29+
contents: write
30+
31+
jobs:
32+
qa:
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v4
36+
with:
37+
ref: ${{ github.ref_name }}
38+
39+
- uses: actions/setup-node@v4
40+
with:
41+
node-version: 20
42+
43+
- name: Install dependencies
44+
working-directory: tools/qa
45+
run: npm install
46+
47+
- name: Install Playwright browsers
48+
working-directory: tools/qa
49+
run: npx playwright install chromium --with-deps
50+
51+
- name: Run tests
52+
working-directory: tools/qa
53+
continue-on-error: true
54+
env:
55+
PATH_PREFIX: ${{ inputs.path_prefix }}
56+
DIFF_THRESHOLD: ${{ inputs.threshold }}
57+
SUITE: ${{ inputs.suite }}
58+
CI: true
59+
run: |
60+
if [ "$SUITE" = "all" ]; then
61+
npx playwright test
62+
else
63+
npx playwright test "test/$SUITE.spec.js"
64+
fi
65+
66+
- name: Write summary
67+
working-directory: tools/qa
68+
env:
69+
PATH_PREFIX: ${{ inputs.path_prefix }}
70+
DIFF_THRESHOLD: ${{ inputs.threshold }}
71+
SUITE: ${{ inputs.suite }}
72+
run: node summarize.js
73+
74+
- name: Commit results
75+
run: |
76+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
77+
git config user.name "github-actions[bot]"
78+
git pull --rebase origin ${{ github.ref_name }}
79+
git add tools/qa/results/latest.json
80+
git diff --staged --quiet || git commit -m "chore: update qa results [skip ci]"
81+
git push origin ${{ github.ref_name }}

0 commit comments

Comments
 (0)