-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (53 loc) · 1.55 KB
/
Copy pathci.yml
File metadata and controls
68 lines (53 loc) · 1.55 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
name: CI
on:
push:
branches: [master]
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
test:
name: Typecheck and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Enable Corepack
run: corepack enable
- uses: actions/setup-node@v7
with:
node-version-file: .nvmrc
cache: yarn
- run: yarn install --immutable
- run: yarn typecheck
- run: yarn test
check-dist:
name: dist/ is up to date
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Enable Corepack
run: corepack enable
- uses: actions/setup-node@v7
with:
node-version-file: .nvmrc
cache: yarn
- run: yarn install --immutable
- run: yarn build
# The runner executes the committed bundle, never the sources, so a dist/ that
# lags behind src/ ships old behaviour to everyone using the action. Catch it here
# instead of in someone else's pipeline.
- name: Compare the rebuilt bundle with the committed one
id: diff
run: |
if [ -n "$(git status --porcelain dist/)" ]; then
echo "dist/ is out of date. Run 'yarn build' and commit the result." >&2
git diff --stat -- dist/ >&2
exit 1
fi
- name: Upload the rebuilt bundle for inspection
if: failure() && steps.diff.outcome == 'failure'
uses: actions/upload-artifact@v7
with:
name: dist
path: dist/