This repository was archived by the owner on Jan 28, 2026. It is now read-only.
release test #31
Workflow file for this run
This file contains hidden or 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: Split-Module GUI Test Pipeline | |
| on: | |
| pull_request: | |
| branches: [ main ] | |
| # ─────────────────────────────────────────────────────────────── | |
| # 1. Playwright tests → artifacts (no Pages here) | |
| # ─────────────────────────────────────────────────────────────── | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| cache: npm | |
| - run: npm install | |
| # ── run Playwright with MAIN-branch comparison ──────────── | |
| - name: GUI Test – Playwright only | |
| uses: DigitalProductInnovationAndDevelopment/Code-Reviews-of-GUI-Tests@v1.0.20 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| mode: test-only | |
| test-files: tests | |
| enable-dashboard: 'false' | |
| enable-github-pages: 'false' | |
| enable-visual-comparison: 'true' # ← comparison switch ON | |
| main-branch: 'main' | |
| key-test-file: 'tests/demo-todo-app.spec.ts' | |
| # ── build summary JSON (PR) ------------------------------ | |
| - name: Build playwright-summary-pr.json | |
| run: | | |
| node - <<'EOF' | |
| const fs = require('fs'); | |
| const rpt = JSON.parse(fs.readFileSync('artifacts/playwright-metrics.json','utf8')); | |
| const out = { | |
| total: rpt.stats.tests, | |
| passed: rpt.stats.passed, | |
| failed: rpt.stats.failed, | |
| skipped: rpt.stats.skipped, | |
| duration: rpt.stats.duration, | |
| pass_rate: +((rpt.stats.passed / rpt.stats.tests) * 100).toFixed(2) | |
| }; | |
| fs.writeFileSync('artifacts/playwright-summary-pr.json', JSON.stringify(out, null, 2)); | |
| EOF | |
| # ── alias file so checklist ticks “Playwright tests completed” ───────── | |
| - run: cp artifacts/playwright-summary-pr.json artifacts/playwright-summary.json | |
| # ── upload artifacts needed by dashboard job ────────────── | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: playwright-summary | |
| path: artifacts/playwright-summary-pr.json | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: playwright-summary-main | |
| path: artifacts/playwright-summary-main.json | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: playwright-metrics | |
| path: artifacts/playwright-metrics.json | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: playwright-report | |
| path: artifacts/pr-report/ | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: playwright-report-main | |
| path: artifacts/main-report/ | |
| # ─────────────────────────────────────────────────────────────── | |
| # 2. ESLint / Prettier | |
| # ─────────────────────────────────────────────────────────────── | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| cache: npm | |
| - run: npm install | |
| - name: GUI Test – Lint only | |
| uses: DigitalProductInnovationAndDevelopment/Code-Reviews-of-GUI-Tests@v1.0.20 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| mode: lint-only | |
| - name: Upload lint-summary.json | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: lint-summary | |
| path: artifacts/lint-summary.json | |
| # ─────────────────────────────────────────────────────────────── | |
| # 3. Dashboard / checklist / PR comment / Pages | |
| # ─────────────────────────────────────────────────────────────── | |
| dashboard: | |
| needs: [ test, lint ] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.review.outputs.dashboard-url }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install npm only if needed | |
| run: | | |
| if [ -f package.json ]; then | |
| npm ci 2>/dev/null || npm install | |
| fi | |
| # ── download all required artifacts ─────────────────────── | |
| - uses: actions/download-artifact@v4 | |
| with: { name: playwright-summary, path: dl } | |
| - uses: actions/download-artifact@v4 | |
| with: { name: playwright-summary-main, path: dl } | |
| - uses: actions/download-artifact@v4 | |
| with: { name: playwright-metrics, path: dl } | |
| - uses: actions/download-artifact@v4 | |
| with: { name: playwright-report, path: dl/pr-report } | |
| - uses: actions/download-artifact@v4 | |
| with: { name: playwright-report-main, path: dl/main-report } | |
| - uses: actions/download-artifact@v4 | |
| with: { name: lint-summary, path: dl } | |
| # ── build dashboard, flowchart, PR comment, deploy Pages ── | |
| - id: review | |
| name: Dashboard / PR comment / Pages | |
| uses: DigitalProductInnovationAndDevelopment/Code-Reviews-of-GUI-Tests@v1.0.20 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| mode: dashboard-only | |
| custom-artifacts-path: dl | |
| enable-github-pages: 'true' |