Repository navigation
102 lines (84 loc) · 3.01 KB
/
Copy pathdeploy.yml
File metadata and controls
102 lines (84 loc) · 3.01 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
90
91
92
93
94
95
96
97
98
99
100
101
102
name: Quality
# The pull-request check: two jobs side by side, about 2.5 minutes. `check`
# proves the app builds and the repo rules hold; `browser-smoke` proves the
# built pages load in a browser. There is no unit-test job: behavior is proven
# end to end, and the slow, paid and full-stack suites run weekly or on demand
# (docs/operations.md lists them).
on:
push:
branches: [ "main" ]
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# One job, so a run pays for one runner start and one cache restore. Every
# step is a few seconds to half a minute; the guards are the Vitest files
# listed in vitest.config.ts, about 2 seconds.
check:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: ./.github/actions/node-deps
- name: Set up Deno
uses: denoland/setup-deno@22d081ff2d3a40755e97629de92e3bcbfa7cf2ed # v2.0.5
with:
deno-version: 2.9.6
cache: true
- name: Documentation
run: npm run docs:check
- name: Lint
run: npm run lint
- name: Typecheck
run: npm run typecheck
- name: Guards
run: npm test
# Edge Functions hold auth, quota and billing, which no pull-request
# browser test reaches.
- name: Edge function tests
run: npm run test:edge
- name: Build
run: npm run build
# The @smoke set: the app boots, sign-in works, every public and signed-in
# page renders without errors, and the first-run tour starts a debate. The
# full desktop and mobile suite runs weekly in browser-weekly.yml.
browser-smoke:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: ./.github/actions/node-deps
- name: Cache Playwright browsers
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- name: Install Chromium
run: npx playwright install --with-deps chromium
- name: Browser smoke tests
env:
CI: 1
PORT: 18080
PLAYWRIGHT_BASE_URL: http://127.0.0.1:18080
run: npm run test:e2e:smoke
- name: Upload browser failure artifacts
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: chromium-smoke-failure-${{ github.run_id }}
path: |
test-results/
playwright-report/
if-no-files-found: ignore
retention-days: 7