blob: f1e0779672dc1bf7027b1c3af2aeff875488ccbd [file] [log] [blame]
Sean McCulloughe8d6b802025-04-21 19:02:05 -07001name: WebUI Tests
2on:
3 workflow_call:
Josh Bleecher Snyder936ba622025-04-30 20:53:21 +00004 inputs:
5 ref:
6 description: "The git ref to checkout"
7 required: false
8 type: string
9 default: ""
Sean McCulloughe8d6b802025-04-21 19:02:05 -070010 push:
11 branches-ignore:
Josh Bleecher Snyder93bb66a2025-04-30 16:29:05 -070012 - "queue-main-*"
13 - "queue-dev-*"
Sean McCulloughe8d6b802025-04-21 19:02:05 -070014 paths:
Josh Bleecher Snyder40ffb842025-04-30 16:28:44 -070015 - "webui/**"
Sean McCulloughe8d6b802025-04-21 19:02:05 -070016 pull_request:
17 paths:
Josh Bleecher Snyder40ffb842025-04-30 16:28:44 -070018 - "webui/**"
Sean McCulloughe8d6b802025-04-21 19:02:05 -070019
20jobs:
21 test:
22 runs-on: ubuntu-latest
23 steps:
24 - uses: actions/checkout@v4
Josh Bleecher Snyder936ba622025-04-30 20:53:21 +000025 with:
26 ref: ${{ inputs.ref }}
Sean McCulloughe8d6b802025-04-21 19:02:05 -070027
28 - name: Setup Node.js
29 uses: actions/setup-node@v4
30 with:
Josh Bleecher Snyder40ffb842025-04-30 16:28:44 -070031 node-version: "20"
32 cache: "npm"
Philip Zeyliger2032b1c2025-04-23 19:40:42 -070033 cache-dependency-path: webui/package-lock.json
Sean McCulloughe8d6b802025-04-21 19:02:05 -070034
35 - name: Install dependencies
Philip Zeyliger2032b1c2025-04-23 19:40:42 -070036 working-directory: ./webui
Sean McCulloughe8d6b802025-04-21 19:02:05 -070037 run: npm ci
38
Philip Zeyliger4f50a682025-04-23 19:34:55 -070039 - name: Install Playwright Chromium
Philip Zeyliger2032b1c2025-04-23 19:40:42 -070040 working-directory: ./webui
Philip Zeyliger4f50a682025-04-23 19:34:55 -070041 run: npx playwright install chromium --with-deps
Sean McCulloughe8d6b802025-04-21 19:02:05 -070042
43 - name: Run tests
Philip Zeyliger2032b1c2025-04-23 19:40:42 -070044 working-directory: ./webui
Sean McCulloughe8d6b802025-04-21 19:02:05 -070045 run: npm run test
46
47 - name: Upload test results
48 if: always()
49 uses: actions/upload-artifact@v4
50 with:
51 name: playwright-report
Philip Zeyliger2032b1c2025-04-23 19:40:42 -070052 path: webui/playwright-report/
Sean McCulloughe8d6b802025-04-21 19:02:05 -070053 retention-days: 7