blob: 2fc312fcdc2acf04991c913f758c9e81a2667fcc [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
philip.zeyliger46be0962025-06-14 17:51:15 +000035 - name: Optimize APT
36 run: ./.github/scripts/optimize-apt.sh
37
Sean McCulloughe8d6b802025-04-21 19:02:05 -070038 - name: Install dependencies
Philip Zeyliger2032b1c2025-04-23 19:40:42 -070039 working-directory: ./webui
Sean McCulloughe8d6b802025-04-21 19:02:05 -070040 run: npm ci
41
Philip Zeyliger4f50a682025-04-23 19:34:55 -070042 - name: Install Playwright Chromium
Philip Zeyliger2032b1c2025-04-23 19:40:42 -070043 working-directory: ./webui
Philip Zeyliger4f50a682025-04-23 19:34:55 -070044 run: npx playwright install chromium --with-deps
Sean McCulloughe8d6b802025-04-21 19:02:05 -070045
46 - name: Run tests
Philip Zeyliger2032b1c2025-04-23 19:40:42 -070047 working-directory: ./webui
Sean McCulloughe8d6b802025-04-21 19:02:05 -070048 run: npm run test
49
50 - name: Upload test results
51 if: always()
52 uses: actions/upload-artifact@v4
53 with:
54 name: playwright-report
Philip Zeyliger2032b1c2025-04-23 19:40:42 -070055 path: webui/playwright-report/
Sean McCulloughe8d6b802025-04-21 19:02:05 -070056 retention-days: 7