-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (44 loc) · 1.65 KB
/
Copy pathci-npm.yml
File metadata and controls
47 lines (44 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: CI (npm)
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
# Per-SHA group: re-runs of the same commit dedupe, but a new commit never
# cancels an earlier commit's in-flight run (release CI conclusions stay intact).
concurrency:
group: ${{ github.workflow_ref }}-${{ github.sha }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 24
- run: npm ci
- name: JS syntax gate + unit tests
run: npm test
# Resolve the exact Playwright version from the lockfile so the browser
# cache invalidates whenever @playwright/test is bumped.
- name: Resolve Playwright version
id: pw
run: echo "version=$(node -p "require('./package-lock.json').packages['node_modules/@playwright/test'].version")" >> "$GITHUB_OUTPUT"
- name: Cache Playwright browsers
id: pw-cache
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ steps.pw.outputs.version }}
- name: Install Playwright chromium (browser + deps)
if: steps.pw-cache.outputs.cache-hit != 'true'
run: npx playwright install --with-deps chromium
# On a cache hit the browser binary is restored but system libraries are
# not cached, so the OS deps must still be installed.
- name: Install Playwright system deps (cache hit)
if: steps.pw-cache.outputs.cache-hit == 'true'
run: npx playwright install-deps chromium
- name: E2E tests
run: npm run test:e2e