@@ -10,30 +10,24 @@ jobs:
10
10
check-lint :
11
11
name : " Check / Lint"
12
12
runs-on : ubuntu-latest
13
- container :
14
- image : ghcr.io/matrixai/github-runner
15
13
steps :
16
14
- uses : actions/checkout@v4
17
15
- name : Run linting
18
16
run : |
19
- nix develop --command bash -c $'
17
+ npm install
20
18
npm run lint
21
19
npm run lint-shell
22
- '
23
20
24
21
check-test :
25
22
name : " Check / Test"
26
23
runs-on : ubuntu-latest
27
- container :
28
- image : ghcr.io/matrixai/github-runner
29
24
steps :
30
25
- uses : actions/checkout@v4
31
26
- name : Run tests
32
27
run : |
33
- nix develop .#ci --command bash -c $'
28
+ npm install
34
29
npm run prebuild --verbose
35
30
npm test -- --ci --coverage
36
- '
37
31
- uses : actions/upload-artifact@v4
38
32
with :
39
33
name : coverage-report
42
36
build-pull :
43
37
name : " Build / Pull Request"
44
38
runs-on : ubuntu-latest
45
- needs : [check-lint, check-test]
46
39
if : github.ref == 'refs/heads/staging'
47
40
steps :
48
41
- uses : actions/checkout@v4
@@ -62,152 +55,13 @@ jobs:
62
55
--body-file - \
63
56
--repo "$GITHUB_REPOSITORY"
64
57
65
- build-dist :
66
- name : " Build / Dist"
67
- runs-on : ubuntu-latest
68
- container :
69
- image : ghcr.io/matrixai/github-runner
70
- needs : [check-lint, check-test]
71
- if : github.ref == 'refs/heads/staging'
72
- steps :
73
- - uses : actions/checkout@v4
74
- - run : |
75
- nix develop .#ci --command bash -c $'
76
- npm run build --ignore-scripts --verbose
77
- '
78
- - uses : actions/upload-artifact@v4
79
- with :
80
- name : dist
81
- path : ./dist
82
-
83
- build-platforms :
84
- name : " Build / Platforms"
85
- runs-on : ${{ matrix.os }}
86
- container :
87
- image : ${{ matrix.platform == 'linux' && 'ghcr.io/matrixai/github-runner' || null }}
88
- needs : build-dist
89
- if : github.ref == 'refs/heads/staging'
90
- strategy :
91
- fail-fast : false
92
- matrix :
93
- include :
94
- - platform : linux
95
- os : ubuntu-latest
96
- env :
97
- npm_config_arch : " x64"
98
- RUST_BACKTRACE : " 1"
99
- script : |
100
- nix develop .#ci --command bash -c $'
101
- npm run prebuild --verbose -- --production
102
- npm test -- --ci --coverage
103
- npm run bench
104
- '
105
- - platform : windows
106
- os : windows-latest
107
- env :
108
- npm_config_arch : " x64"
109
- RUST_BACKTRACE : " 1"
110
- LIBCLANG_PATH : " C:\\ Program Files\\ LLVM\\ bin"
111
- script : |
112
- mkdir -Force "$CI_PROJECT_DIR/tmp"
113
- Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
114
- ./scripts/choco-install.ps1
115
- refreshenv
116
- npm install --ignore-scripts
117
- $env:Path = "$(npm root)\.bin;" + $env:Path
118
- npm run prebuild --verbose -- --production
119
- npm test -- --ci --coverage
120
- npm run bench
121
- - platform : macos
122
- os : macos-latest
123
- env :
124
- RUST_BACKTRACE : " 1"
125
- script : |
126
- eval "$(brew shellenv)"
127
- ./scripts/brew-install.sh
128
- hash -r
129
- npm install --ignore-scripts
130
- export PATH="$(npm root)/.bin:$PATH"
131
- export PATH="$HOME/.cargo/bin:$PATH"
132
- npm run prebuild --verbose -- --arch x64 --production
133
- npm run prebuild --verbose -- --arch arm64 --production
134
- lipo -create -output prebuild/quic-darwin-x64+arm64.node prebuild/quic-darwin-arm64.node prebuild/quic-darwin-x64.node
135
- rm -rf node_modules/@matrixai/quic-*
136
- npm test -- --ci --coverage
137
- npm run bench
138
- steps :
139
- - uses : actions/checkout@v4
140
- - uses : actions/setup-node@v4
141
- with :
142
- node-version : ' 20'
143
- - uses : actions/download-artifact@v4
144
- with :
145
- name : dist
146
- path : ./dist
147
- - name : Build
148
- env : ${{ matrix.env }}
149
- run : ${{ matrix.script }}
150
- - uses : actions/upload-artifact@v4
151
- with :
152
- name : builds-${{ matrix.platform }}
153
- path : ./builds
154
-
155
- build-prerelease :
156
- name : " Build / Pre-release"
157
- runs-on : ubuntu-latest
158
- container :
159
- image : ghcr.io/matrixai/github-runner
160
- concurrency :
161
- group : build-prerelease
162
- cancel-in-progress : false
163
- needs : [check-lint, check-test]
164
- if : >
165
- github.ref == 'refs/heads/staging' &&
166
- startsWith(github.ref, 'refs/tags/v') &&
167
- contains(github.ref, '-')
168
- steps :
169
- - uses : actions/checkout@v4
170
- - uses : actions/download-artifact@v4
171
- with :
172
- pattern : builds*
173
- path : builds
174
- merge-multiple : true
175
- - name : Run pre-release
176
- env :
177
- GH_TOKEN : ${{ secrets.GH_TOKEN }}
178
- run : |
179
- echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ./.npmrc
180
- echo 'Publishing library prerelease'
181
- nix develop .#ci --command bash -c $'
182
- npm publish --tag prerelease --access public
183
- '
184
- for d in prebuild/*; do
185
- tar \
186
- --create \
187
- --verbose \
188
- --file="prebuild/$(basename $d).tar" \
189
- --directory=prebuild \
190
- "$(basename $d)"
191
- done
192
- nix develop .#ci --command bash -c $'
193
- gh release \
194
- create "$GITHUB_REF_NAME" \
195
- prebuild/*.tar \
196
- --title "$GITHUB_REF_NAME-$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \
197
- --notes "" \
198
- --prerelease \
199
- --target staging \
200
- --repo "$GITHUB_REPOSITORY"
201
- '
202
- rm -f ./.npmrc
203
-
204
58
integration-merge :
205
59
name : " Integration / Merge"
206
60
runs-on : ubuntu-latest
207
61
concurrency :
208
62
group : integration-merge
209
63
cancel-in-progress : true
210
- needs : [ build-pull, build-platforms]
64
+ needs : build-pull
211
65
if : github.ref == 'refs/heads/staging'
212
66
steps :
213
67
- uses : actions/checkout@v4
@@ -230,50 +84,3 @@ jobs:
230
84
git merge --ff-only "$GITHUB_SHA"
231
85
git push origin master
232
86
233
- release-distribution :
234
- name : " Release / Distribution"
235
- runs-on : ubuntu-latest
236
- container :
237
- image : ghcr.io/matrixai/github-runner
238
- concurrency :
239
- group : release-distribution
240
- cancel-in-progress : false
241
- needs : integration-merge
242
- if : >
243
- github.ref == 'refs/heads/staging' &&
244
- startsWith(github.ref, 'refs/tags/v') &&
245
- !contains(github.ref, '-')
246
- steps :
247
- - uses : actions/checkout@v4
248
- - uses : actions/download-artifact@v4
249
- with :
250
- pattern : builds*
251
- path : builds
252
- merge-multiple : true
253
- - name : Run release
254
- env :
255
- GH_TOKEN : ${{ secrets.GH_TOKEN }}
256
- run : |
257
- echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ./.npmrc
258
- echo 'Publishing library'
259
- nix develop .#ci --command bash -c $'
260
- npm publish --access public
261
- '
262
- for d in prebuild/*; do
263
- tar \
264
- --create \
265
- --verbose \
266
- --file="prebuild/$(basename $d).tar" \
267
- --directory=prebuild \
268
- "$(basename $d)"
269
- done
270
- nix develop .#ci --command bash -c $'
271
- gh release \
272
- create "$GITHUB_REF_NAME" \
273
- prebuild/*.tar \
274
- --title "$GITHUB_REF_NAME-$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \
275
- --notes "" \
276
- --target master \
277
- --repo "$GITHUB_REPOSITORY"
278
- '
279
- rm -f ./.npmrc
0 commit comments