-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (66 loc) · 2.08 KB
/
Copy pathcheck.yml
File metadata and controls
79 lines (66 loc) · 2.08 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
name: Check
# Everything that decides whether a change is allowed to land. The three publish
# workflows beside this one only ship what has already been merged, so until this
# existed nothing in CI had ever run a test.
on:
push:
branches:
- main
- master
pull_request:
workflow_dispatch:
concurrency:
group: check-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
runs-on: ubuntu-latest
# Separate jobs rather than steps, so a failing formatter still tells you
# whether the tests pass. One job would stop at the first thing that broke and
# hide the rest behind it.
strategy:
fail-fast: false
matrix:
include:
- name: test
run: bun test
- name: lint
run: bun run lint
- name: format
run: bun run format:check
name: ${{ matrix.name }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Run ${{ matrix.name }}
run: ${{ matrix.run }}
# `tsc.sh` reports a failure by printing "Failed:" and carrying on to the next
# package, so that one broken tsconfig does not hide the state of the other
# eighteen. That is the right behaviour locally and useless in CI, where a green
# tick would mean nothing. This reads the output back and fails on it.
types:
runs-on: ubuntu-latest
name: types
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Typecheck every package
run: |
bash ./tsc.sh 2>&1 | tee tsc.log
if grep -q '^Failed:' tsc.log; then
echo "::error::At least one package failed to typecheck."
grep '^Failed:' tsc.log
exit 1
fi