Skip to content
This repository was archived by the owner on Jan 28, 2026. It is now read-only.

Commit 227a69c

Browse files
committed
release test
1 parent 8477c23 commit 227a69c

2 files changed

Lines changed: 72 additions & 54 deletions

File tree

.github/workflows/releasetest.yaml

Lines changed: 69 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,93 @@
1+
# ───────────────────────────────────────────────────────────────
2+
# Split-Module GUI Test Pipeline
3+
# ───────────────────────────────────────────────────────────────
14
name: Split-Module GUI Test Pipeline
25

36
on:
47
pull_request:
5-
branches: [main]
8+
branches: [ main ]
69

710
jobs:
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

playwright.config.js

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,17 @@
1-
// playwright.config.js
2-
// ------------------------------------------------------------
3-
// Generates three reporters:
4-
// • list – nice console output on CI
5-
// • json – metrics saved to ./playwright-metrics.json
6-
// • html – full HTML report in ./playwright-report/
7-
// ------------------------------------------------------------
81
const { defineConfig } = require('@playwright/test');
92

103
module.exports = defineConfig({
114
testDir: './tests',
12-
13-
/* Browser / context defaults */
145
use: {
156
headless: true,
167
screenshot: 'on',
178
trace: 'on',
189
video: 'off',
1910
ignoreHTTPSErrors: true,
2011
},
21-
22-
/* Reporters – order does not matter */
2312
reporter: [
24-
// human-readable console list
25-
[ 'list' ],
26-
27-
// machine-readable metrics JSON
28-
[ 'json', { outputFile: /** absolute path is safer */ require('path').resolve(__dirname, 'playwright-metrics.json') } ],
29-
30-
// self-contained HTML report (for dashboard)
31-
[ 'html', { outputFolder: 'playwright-report', open: 'never' } ],
13+
['list'],
14+
['json', { outputFile: 'playwright-metrics.json' }], // ← relative path
15+
['html', { outputFolder: 'playwright-report', open: 'never' }],
3216
],
3317
});

0 commit comments

Comments
 (0)