Repository navigation
85 lines (78 loc) · 2.41 KB
/
Copy pathnode.js.yml
File metadata and controls
85 lines (78 loc) · 2.41 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
name: Build
on:
workflow_dispatch:
pull_request:
branches: [develop]
push:
branches: [develop]
permissions:
contents: read
# Keyed by ref so a merge into develop cannot cancel an unrelated pull
# request's checks. Runs for the same ref still supersede each other.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
# Only `pnpm run test:integration` needs chromedriver, and no job here runs it.
CHROMEDRIVER_SKIP_DOWNLOAD: 'true'
# The three jobs run in parallel. Together they run what `pnpm run check:full` runs locally.
jobs:
static:
name: Lint and static checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: pnpm
# Nothing here runs dependency build scripts.
- run: pnpm install --frozen-lockfile --ignore-scripts
- run: pnpm run lint
- run: pnpm run typecheck
- run: node scripts/check-conventions.mjs --base=origin/${{ github.base_ref }}
if: github.event_name == 'pull_request'
- run: pnpm run i18n:editor:check
- run: pnpm run i18n:community:check
- run: pnpm run check:community-css
- run: pnpm run deps:check
unit:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm run test:unit:ci --reporters=default --reporters=github-actions
build:
name: Production build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: pnpm
# Cloudflare Pages also installs without build scripts (scripts/cloudflare-build.mjs).
- run: pnpm install --frozen-lockfile --ignore-scripts
# The community site build, as deployed. build:deploy raises Node's heap limit itself.
- run: pnpm run build:deploy
env:
NODE_ENV: production
- run: pnpm run validate-deploy
- uses: actions/upload-artifact@v4
with:
name: build
path: build/
retention-days: 7