Repository navigation
89 lines (70 loc) · 2.15 KB
/
Copy pathci.yml
File metadata and controls
89 lines (70 loc) · 2.15 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
# Runs the checks listed in CONTRIBUTING.md on every pull request and on main.
#
# Node: the manifest pins neither Node nor a package manager, so CI uses the
# version this project is developed against. Next 16 requires >= 20.9.
name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
# A new push to the same branch supersedes an in-flight run.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
NODE_VERSION: "24"
jobs:
checks:
name: unit, types, lint, build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
- run: npm ci
- name: Unit tests
run: npm test
- name: Sharing source contracts
run: node --test scripts/social-metadata.test.mjs
- name: Types
run: npm run typecheck
- name: Lint
run: npm run lint
- name: Production build
run: npm run build
e2e:
name: end-to-end (Playwright)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
- run: npm ci
# Keyed on the lockfile, so the cache is rebuilt when Playwright's version moves.
- name: Cache Playwright browsers
uses: actions/cache@v6
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- name: Install Chromium
run: npx playwright install --with-deps chromium
# playwright.config.ts builds the app and serves it with the key unset, so
# the suite runs in demo mode and needs no credentials.
- name: End-to-end tests
run: npm run e2e
- name: Upload report and sharing evidence
if: always()
uses: actions/upload-artifact@v7
with:
name: playwright-report
path: |
playwright-report/
test-results/
if-no-files-found: ignore
retention-days: 7