-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (81 loc) · 2.35 KB
/
Copy pathci.yml
File metadata and controls
89 lines (81 loc) · 2.35 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
# A newer push makes an in-progress run of the same ref pointless.
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
# Chromium is installed explicitly where it is needed, so keep it out of
# every other `npm ci`.
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'
jobs:
static:
name: Lint, types and packaging
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 22
cache: npm
- run: npm ci
- run: npm run lint
- run: npm run typecheck
- run: npm run format:check
- run: npm run build
# Catches a broken `exports` map or mistyped dual-format output, which
# unit tests cannot see because they import from src.
- run: npm run check:packaging
unit:
name: Unit tests (Node ${{ matrix.node }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: [22, 24]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node }}
cache: npm
- run: npm ci
- run: npm run test:coverage
integration:
name: Integration tests (real Chromium)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 22
cache: npm
- run: npm ci
# --with-deps pulls the system libraries Chromium needs on a bare runner.
- run: npx playwright install --with-deps chromium
- run: npm run test:integration
docker:
name: Docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: docker/setup-buildx-action@v4
- name: Build
uses: docker/build-push-action@v7
with:
context: .
load: true
tags: renderready:ci
cache-from: type=gha
cache-to: type=gha,mode=max
# Building proves very little on its own. This renders a real page through
# the container, forces several browser recycles, and fails if they leak
# zombie Chromium processes — see scripts/docker-smoke.sh.
- name: Smoke test the image
run: scripts/docker-smoke.sh renderready:ci