generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 23
222 lines (222 loc) · 7.72 KB
/
pr_checks.yml
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
name: PR Checks
on:
pull_request:
push:
branches:
- master
tags: '*'
concurrency:
# Skip intermediate builds: all builds except for builds on the `master` branch
# Cancel intermediate builds: only pull request builds
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.run_number }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
permissions:
contents: read
jobs:
finalize-pr-checks:
if: always() # this line is important to keep the `finalize` job from being marked as skipped; do not change or delete this line
runs-on: ubuntu-latest
timeout-minutes: 10
needs:
- checked-in-files
- build
- npm-run-test
- make-targets
- stalecheck-npm-install
steps:
- run: |
echo checked-in-files: ${{ needs.checked-in-files.result }}
echo build: ${{ needs.build.result }}
echo npm-run-test: ${{ needs.npm-run-test.result }}
echo make-targets: ${{ needs.make-targets.result }}
echo stalecheck-npm-install: ${{ needs.stalecheck-npm-install.result }}
- run: exit 1
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }}
checked-in-files:
timeout-minutes: 30
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
### Check out the repo:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
persist-credentials: false
### Cleanall:
- run: make cleanall
### Install NodeJS
# Unix (non-Windows):
- uses: asdf-vm/actions/setup@05e0d2ed97b598bfce82fd30daf324ae0c4570e6
if: runner.os != 'Windows'
- run: make unix-asdf-install
if: runner.os != 'Windows'
# Windows:
# Windows does not support asdf, so we have to use `actions/setup-node`
# to install asdf:
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
if: runner.os == 'Windows'
with:
node-version-file: '.tool-versions'
### Install the NodeJS packages that we depend on:
- run: make install-packages
### Print some debugging info:
- name: Print the NodeJS version (for debugging)
run: |
which -a node
node --version
which -a npm
npm --version
### Build:
- run: make pack
### Clean (not cleanall!):
- run: make clean
### Make sure there are no uncommited changes
- uses: julia-actions/setup-julia@9b79636afcfb07ab02c256cede01fe2db6ba808c # v2.6.0
with:
version: '1'
- run: git --no-pager status
- run: git --no-pager diff
- run: julia ./ci/check_uncommitted_changes.jl
build:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
### Check out the repo:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
persist-credentials: false
### Cleanall:
- run: make cleanall
### Install NodeJS
# Unix (non-Windows):
- uses: asdf-vm/actions/setup@05e0d2ed97b598bfce82fd30daf324ae0c4570e6
if: runner.os != 'Windows'
- run: make unix-asdf-install
if: runner.os != 'Windows'
# Windows:
# Windows does not support asdf, so we have to use `actions/setup-node`
# to install asdf:
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
if: runner.os == 'Windows'
with:
node-version-file: '.tool-versions'
### Install the NodeJS packages that we depend on:
- run: make install-packages
### Print some debugging info:
- name: Print the NodeJS version (for debugging)
run: |
which -a node
node --version
which -a npm
npm --version
### Build:
- run: make build
- run: make pack
### Make sure some other `make` targets don't bitrot:
- name: Run some other `make` targets to ensure that they don't bitrot
run: |
make clean
make cleanall
- name: Run all of the "cleaning" `make` targets to ensure that they don't bitrot
run: |
make clean
make cleanall
npm-run-test:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
### Check out the repo:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
persist-credentials: false
### Cleanall:
- run: make cleanall
### Install NodeJS
# Unix (non-Windows):
- uses: asdf-vm/actions/setup@05e0d2ed97b598bfce82fd30daf324ae0c4570e6
if: runner.os != 'Windows'
- run: make unix-asdf-install
if: runner.os != 'Windows'
# Windows:
# Windows does not support asdf, so we have to use `actions/setup-node`
# to install asdf:
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
if: runner.os == 'Windows'
with:
node-version-file: '.tool-versions'
### Install the NodeJS packages that we depend on:
- run: make install-packages
### Print some debugging info:
- name: Print the NodeJS version (for debugging)
run: |
which -a node
node --version
which -a npm
npm --version
### Build:
- run: make build
- run: make test
make-targets: # This is a job to make sure that none of the `make` targets bitrot
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
### Check out the repo:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
persist-credentials: false
### Cleanall:
- run: make cleanall
### Install NodeJS
# Unix (non-Windows):
- uses: asdf-vm/actions/setup@05e0d2ed97b598bfce82fd30daf324ae0c4570e6
if: runner.os != 'Windows'
- run: make unix-asdf-install
if: runner.os != 'Windows'
### Install the NodeJS packages that we depend on:
- run: make install-packages
### Make sure some other `make` targets don't bitrot:
- name: Run some other `make` targets to ensure that they don't bitrot
run: |
make unix-asdf-install
make install-packages
make build
make pack
make everything-from-scratch
- name: Run all of the "cleaning" `make` targets to ensure that they don't bitrot
run: |
make clean
make cleanall
stalecheck-npm-install:
# In this job, we are basically trying to check if `package-lock.json` is in
# sync with `package-lock.json`.
#
# So, for example, if someone manually edits the `package.json` file, we want
# to make sure that the `package-lock.json` file is not out of sync with the
# `package.json` file.
timeout-minutes: 30
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
### Check out the repo:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
persist-credentials: false
### Install NodeJS
# Unix (non-Windows):
- uses: asdf-vm/actions/setup@05e0d2ed97b598bfce82fd30daf324ae0c4570e6
if: runner.os != 'Windows'
- run: make unix-asdf-install
if: runner.os != 'Windows'
### Run the master commands for this job:
- run: make clean
- run: npm ci
# - run: npm install --package-lock-only
- run: npm install
### Make sure there are no uncommited changes
- uses: julia-actions/setup-julia@9b79636afcfb07ab02c256cede01fe2db6ba808c # v2.6.0
with:
version: '1'
- run: git --no-pager status
- run: git --no-pager diff
- run: julia ./ci/check_uncommitted_changes.jl