blob: 490f162a523e0a83590d8f10b6ddabb34ed72804 [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: ""
Philip Zeyliger037f3162025-06-20 22:26:31 +000010 working-directory:
11 description: "Working directory for the workflow"
12 required: false
13 type: string
14 default: "."
Sean McCulloughe8d6b802025-04-21 19:02:05 -070015 push:
16 branches-ignore:
Josh Bleecher Snyder93bb66a2025-04-30 16:29:05 -070017 - "queue-main-*"
18 - "queue-dev-*"
Sean McCulloughe8d6b802025-04-21 19:02:05 -070019 paths:
Josh Bleecher Snyder40ffb842025-04-30 16:28:44 -070020 - "webui/**"
Sean McCulloughe8d6b802025-04-21 19:02:05 -070021 pull_request:
22 paths:
Josh Bleecher Snyder40ffb842025-04-30 16:28:44 -070023 - "webui/**"
Sean McCulloughe8d6b802025-04-21 19:02:05 -070024
25jobs:
26 test:
Philip Zeyliger8a290e52025-06-15 20:59:58 -070027 runs-on: linux-x64-ubuntu-latest-64-core
Sean McCulloughe8d6b802025-04-21 19:02:05 -070028 steps:
29 - uses: actions/checkout@v4
Josh Bleecher Snyder936ba622025-04-30 20:53:21 +000030 with:
31 ref: ${{ inputs.ref }}
Sean McCulloughe8d6b802025-04-21 19:02:05 -070032
33 - name: Setup Node.js
34 uses: actions/setup-node@v4
35 with:
Josh Bleecher Snyder40ffb842025-04-30 16:28:44 -070036 node-version: "20"
37 cache: "npm"
Philip Zeyliger037f3162025-06-20 22:26:31 +000038 cache-dependency-path: ${{ inputs.working-directory || '.'}}/webui/package-lock.json
Sean McCulloughe8d6b802025-04-21 19:02:05 -070039
philip.zeyliger46be0962025-06-14 17:51:15 +000040 - name: Optimize APT
Philip Zeyliger037f3162025-06-20 22:26:31 +000041 working-directory: ${{ inputs.working-directory || '.'}}
42 run: |
43 pwd
44 ./.github/scripts/optimize-apt.sh
philip.zeyliger46be0962025-06-14 17:51:15 +000045
Sean McCulloughe8d6b802025-04-21 19:02:05 -070046 - name: Install dependencies
Philip Zeyliger037f3162025-06-20 22:26:31 +000047 working-directory: ${{ inputs.working-directory || '.'}}/webui
Sean McCulloughe8d6b802025-04-21 19:02:05 -070048 run: npm ci
49
Philip Zeyliger4f50a682025-04-23 19:34:55 -070050 - name: Install Playwright Chromium
Philip Zeyliger037f3162025-06-20 22:26:31 +000051 working-directory: ${{ inputs.working-directory || '.'}}/webui
Philip Zeyliger4f50a682025-04-23 19:34:55 -070052 run: npx playwright install chromium --with-deps
Sean McCulloughe8d6b802025-04-21 19:02:05 -070053
54 - name: Run tests
Philip Zeyliger037f3162025-06-20 22:26:31 +000055 working-directory: ${{ inputs.working-directory || '.'}}/webui
Sean McCulloughe8d6b802025-04-21 19:02:05 -070056 run: npm run test
57
58 - name: Upload test results
59 if: always()
60 uses: actions/upload-artifact@v4
61 with:
62 name: playwright-report
Philip Zeyliger037f3162025-06-20 22:26:31 +000063 path: ${{ inputs.working-directory || '.'}}/webui/playwright-report/
Sean McCulloughe8d6b802025-04-21 19:02:05 -070064 retention-days: 7