1+ # ───────────────────────────────────────────────────────────────
2+ # Split-Module GUI Test Pipeline
3+ # ───────────────────────────────────────────────────────────────
14name : Split-Module GUI Test Pipeline
25
36on :
47 pull_request :
5- branches : [main]
8+ branches : [ main ]
69
710jobs :
8- # ##############################################################################
9- # 1. Playwright tests only
10- # ##############################################################################
11+ # ───────────────────────────────────────────────────────────────
12+ # 1. Playwright tests (produce artifacts, no Pages deploy)
13+ # ───────────────────────────────────────────────────────────────
1114 test :
1215 runs-on : ubuntu-latest
1316 steps :
1417 - uses : actions/checkout@v4
18+
1519 - uses : actions/setup-node@v4
16- with : { cache: npm }
20+ with :
21+ cache : npm
22+
1723 - run : npm install
1824
19- - name : Playwright tests
25+ # Playwright only – dashboard & lint disabled here
26+ - name : GUI Test – Playwright only
2027 uses : DigitalProductInnovationAndDevelopment/Code-Reviews-of-GUI-Tests@v1.0.12
2128 with :
2229 github-token : ${{ secrets.GITHUB_TOKEN }}
2330 mode : test-only
2431 test-files : tests
32+ enable-dashboard : ' false' # let the dashboard job build it
2533 enable-github-pages : ' false'
26- enable-dashboard : ' false'
2734
28- - name : Build JSON summary
35+ # ── build summary AFTER the action has moved the metrics file ─────────
36+ - name : Build playwright-summary-pr.json
37+ shell : bash
2938 run : |
3039 node - <<'EOF'
31- const fs=require('fs');
32- const rpt=JSON.parse(fs.readFileSync('playwright-metrics.json','utf8'));
33- const out={total:rpt.stats.total,
34- passed:rpt.stats.passed??rpt.stats.expected,failed:rpt.stats.failed??rpt.stats.unexpected,
35- skipped:rpt.stats.skipped??0,duration:rpt.stats.duration,
36- pass_rate:+(((rpt.stats.passed??rpt.stats.expected)/rpt.stats.total)*100).toFixed(2)};
37- fs.mkdirSync('artifacts',{recursive:true});
38- fs.writeFileSync('artifacts/playwright-summary-pr.json',JSON.stringify(out,null,2));
39- fs.copyFileSync('playwright-metrics.json','artifacts/playwright-metrics.json');
40+ const fs = require('fs');
41+ const p = JSON.parse(fs.readFileSync('artifacts/playwright-metrics.json','utf8'));
42+ const out = {
43+ total: p.stats.total,
44+ passed: p.stats.passed ?? p.stats.expected,
45+ failed: p.stats.failed ?? p.stats.unexpected,
46+ skipped: p.stats.skipped ?? 0,
47+ duration: p.stats.duration,
48+ pass_rate: +(((p.stats.passed ?? p.stats.expected)/p.stats.total)*100).toFixed(2)
49+ };
50+ fs.writeFileSync('artifacts/playwright-summary-pr.json', JSON.stringify(out, null, 2));
4051 EOF
4152
53+ # ── upload three small artifacts for the dashboard job ────────────────
4254 - uses : actions/upload-artifact@v4
43- with : { name: playwright-summary, path: artifacts/playwright-summary-pr.json }
55+ with :
56+ name : playwright-summary
57+ path : artifacts/playwright-summary-pr.json
58+
4459 - uses : actions/upload-artifact@v4
45- with : { name: playwright-metrics, path: artifacts/playwright-metrics.json }
60+ with :
61+ name : playwright-metrics
62+ path : artifacts/playwright-metrics.json
63+
4664 - uses : actions/upload-artifact@v4
47- with : { name: playwright-report, path: artifacts/pr-report/ }
65+ with :
66+ name : playwright-report
67+ path : artifacts/pr-report/
4868
49- # ##############################################################################
69+ # ───────────────────────────────────────────────────────────────
5070# 2. ESLint / Prettier only
51- # ##############################################################################
71+ # ───────────────────────────────────────────────────────────────
5272 lint :
5373 runs-on : ubuntu-latest
5474 steps :
5575 - uses : actions/checkout@v4
5676 - uses : actions/setup-node@v4
57- with : { cache: npm }
77+ with :
78+ cache : npm
5879 - run : npm install
59- - name : Lint only
80+ - name : GUI Test – Lint only
6081 uses : DigitalProductInnovationAndDevelopment/Code-Reviews-of-GUI-Tests@v1.0.12
6182 with :
6283 github-token : ${{ secrets.GITHUB_TOKEN }}
6384 mode : lint-only
6485
65- # ##############################################################################
66- # 3. Dashboard from artifacts
67- # ##############################################################################
86+ # ───────────────────────────────────────────────────────────────
87+ # 3. Dashboard / checklist / PR comment / Pages deploy
88+ # ───────────────────────────────────────────────────────────────
6889 dashboard :
69- needs : [test, lint]
90+ needs : [ test, lint ]
7091 runs-on : ubuntu-latest
7192
7293 permissions :
@@ -82,22 +103,35 @@ jobs:
82103 steps :
83104 - uses : actions/checkout@v4
84105
106+ # NPM install only if repo provides package.json (avoids EUSAGE)
85107 - name : Install npm if needed
86108 run : |
87- if [ -f package.json ]; then npm ci 2>/dev/null || npm install; fi
109+ if [ -f package.json ]; then
110+ npm ci 2>/dev/null || npm install
111+ fi
88112
113+ # Download the three artifacts produced in the "test" job
89114 - uses : actions/download-artifact@v4
90- with : { name: playwright-summary, path: dl }
115+ with :
116+ name : playwright-summary
117+ path : dl
118+
91119 - uses : actions/download-artifact@v4
92- with : { name: playwright-metrics, path: dl }
120+ with :
121+ name : playwright-metrics
122+ path : dl
123+
93124 - uses : actions/download-artifact@v4
94- with : { name: playwright-report, path: dl/pr-report }
125+ with :
126+ name : playwright-report
127+ path : dl/pr-report
95128
96- - name : Build & deploy dashboard
97- id : review
129+ # Build dashboard, flow-chart, checklist, PR comment, deploy Pages
130+ - id : review
131+ name : Build dashboard & deploy
98132 uses : DigitalProductInnovationAndDevelopment/Code-Reviews-of-GUI-Tests@v1.0.12
99133 with :
100134 github-token : ${{ secrets.GITHUB_TOKEN }}
101135 mode : dashboard-only
102136 custom-artifacts-path : dl
103- enable-github-pages : ' true'
137+ enable-github-pages : ' true' # turn off if you don’t want Pages
0 commit comments