@@ -2,15 +2,23 @@ name: PR/CI Check
2
2
3
3
on :
4
4
pull_request :
5
+ branches :
6
+ - main
7
+ - release*
8
+ - release/*
9
+ - release-*
5
10
push :
6
- branches-ignore :
11
+ branches :
7
12
- main
8
13
- release*
9
14
- release/*
10
15
- release-*
11
16
12
17
jobs :
13
18
tests :
19
+ # Very generic tests, we don't verify whether the envs are discovered correctly or not.
20
+ # However we do ensure that envs that are discovered are valid.
21
+ # See other jobs for specific tests.
14
22
name : Tests
15
23
runs-on : ${{ matrix.os }}
16
24
strategy :
@@ -26,20 +34,12 @@ jobs:
26
34
- os : ubuntu-latest
27
35
target : x86_64-unknown-linux-musl
28
36
run_cli : " yes"
29
- # - os: ubuntu-latest
30
- # target: aarch64-unknown-linux-gnu
31
- # - os: ubuntu-latest
32
- # target: arm-unknown-linux-gnueabihf
33
37
- os : macos-latest
34
38
target : x86_64-apple-darwin
35
39
run_cli : " yes"
36
40
- os : macos-14
37
41
target : aarch64-apple-darwin
38
42
run_cli : " yes"
39
- # - os: ubuntu-latest
40
- # target: x86_64-unknown-linux-gnu
41
- # - os: ubuntu-latest
42
- # target: aarch64-unknown-linux-musl
43
43
steps :
44
44
- name : Checkout
45
45
uses : actions/checkout@v4
@@ -151,6 +151,22 @@ jobs:
151
151
pyenv virtualenv 3.12 pyenv-virtualenv-env1
152
152
shell : bash
153
153
154
+ # region venv
155
+ - name : Create .venv
156
+ # if: startsWith( matrix.os, 'ubuntu') || startsWith( matrix.os, 'macos')
157
+ run : |
158
+ python -m venv .venv
159
+ shell : bash
160
+
161
+ - name : Create .venv2
162
+ # if: startsWith( matrix.os, 'ubuntu') || startsWith( matrix.os, 'macos')
163
+ run : |
164
+ python -m venv .venv2
165
+ shell : bash
166
+
167
+ # endregion venv
168
+
169
+ # Rust
154
170
- name : Rust Tool Chain setup
155
171
uses : dtolnay/rust-toolchain@stable
156
172
with :
@@ -167,7 +183,194 @@ jobs:
167
183
shell : bash
168
184
169
185
- name : Run Tests
170
- run : cargo test --frozen --all-features -- --nocapture
186
+ # Run integration tests in a single thread,
187
+ # We end up creating conda envs and running multiple tests in parallel
188
+ # that creat conda envs simultaneously causes issues (sometimes the conda envs do not seem to get created)
189
+ # Similar issues were identified in vscode-jupyter tests as well (something to do with conda lock files or the like)
190
+ run : cargo test --frozen --features ci -- --nocapture --test-threads=1
191
+ env :
192
+ RUST_BACKTRACE : 1
193
+ RUST_LOG : trace
194
+ shell : bash
195
+
196
+ isolated-tests :
197
+ # Some of these tests are very specific and need to be run in isolation.
198
+ # E.g. we need to ensure we have a poetry project setup correctly (without .venv created using `pip -m venv .venv`).
199
+ # We can try to use the previous `tests` job, but that gets very complicated.
200
+ name : Other Tests
201
+ runs-on : ${{ matrix.os }}
202
+ strategy :
203
+ fail-fast : false
204
+ matrix :
205
+ include :
206
+ - feature : ci-poetry-global
207
+ os : ubuntu-latest
208
+ target : x86_64-unknown-linux-musl
209
+ - feature : ci-poetry-project
210
+ os : ubuntu-latest
211
+ target : x86_64-unknown-linux-musl
212
+ - feature : ci-poetry-custom
213
+ os : ubuntu-latest
214
+ target : x86_64-unknown-linux-musl
215
+ steps :
216
+ - name : Checkout
217
+ uses : actions/checkout@v4
218
+
219
+ # Setup Poetry
220
+ - name : Set Python 3.x to PATH
221
+ if : startsWith( matrix.feature, 'ci-poetry')
222
+ uses : actions/setup-python@v5
223
+ with :
224
+ python-version : " 3.x"
225
+
226
+ - name : Set Python 3.12 to PATH
227
+ if : startsWith( matrix.feature, 'ci-poetry')
228
+ uses : actions/setup-python@v5
229
+ with :
230
+ python-version : " 3.12"
231
+
232
+ - name : Set Python 3.11 to PATH
233
+ if : startsWith( matrix.feature, 'ci-poetry')
234
+ uses : actions/setup-python@v5
235
+ with :
236
+ python-version : " 3.11"
237
+
238
+ - name : Install Poetry (envs globally)
239
+ if : startsWith( matrix.feature, 'ci-poetry-global')
240
+ uses : snok/install-poetry@93ada01c735cc8a383ce0ce2ae205a21c415379b
241
+ with :
242
+ virtualenvs-create : true
243
+ virtualenvs-in-project : false
244
+ installer-parallel : true
245
+
246
+ - name : Install Poetry (env locally)
247
+ if : startsWith( matrix.feature, 'ci-poetry-project')
248
+ uses : snok/install-poetry@93ada01c735cc8a383ce0ce2ae205a21c415379b
249
+ with :
250
+ virtualenvs-create : true
251
+ virtualenvs-in-project : true
252
+ installer-parallel : true
253
+
254
+ - name : Install Poetry (env locally)
255
+ if : startsWith( matrix.feature, 'ci-poetry-custom')
256
+ uses : snok/install-poetry@93ada01c735cc8a383ce0ce2ae205a21c415379b
257
+ with :
258
+ virtualenvs-create : true
259
+ virtualenvs-in-project : false
260
+ virtualenvs-path : ~/my-custom-path
261
+ installer-parallel : true
262
+
263
+ - name : Petry config
264
+ if : startsWith( matrix.feature, 'ci-poetry')
265
+ run : poetry config --list
266
+ shell : bash
267
+
268
+ - name : Petry setup
269
+ if : startsWith( matrix.feature, 'ci-poetry')
270
+ # We want to have 2 envs for this poetry project 3.12 and 3.11.
271
+ run : poetry init --name=pet-test --python=^3.11 -q -n
272
+ shell : bash
273
+
274
+ - name : Petry virtual env setup 3.12
275
+ if : startsWith( matrix.feature, 'ci-poetry')
276
+ run : poetry env use python3.12
277
+ shell : bash
278
+
279
+ - name : Petry virtual env setup 3.11
280
+ if : startsWith( matrix.feature, 'ci-poetry')
281
+ run : poetry env use python3.11
282
+ shell : bash
283
+
284
+ - name : Petry list envs
285
+ if : startsWith( matrix.feature, 'ci-poetry')
286
+ run : poetry env list
287
+ shell : bash
288
+
289
+ - name : Petry pyproject.toml
290
+ if : startsWith( matrix.feature, 'ci-poetry')
291
+ run : cat pyproject.toml
292
+ shell : bash
293
+
294
+ # # Dump env vars
295
+ # - name: Env
296
+ # run: set
297
+ # shell: bash
298
+
299
+ # Rust
300
+ - name : Rust Tool Chain setup
301
+ uses : dtolnay/rust-toolchain@stable
302
+ with :
303
+ toolchain : stable
304
+ targets : ${{ matrix.target }}
305
+
306
+ - name : Cargo Fetch
307
+ run : cargo fetch
308
+ shell : bash
309
+
310
+ - name : Find Environments
311
+ run : cargo run --release --target ${{ matrix.target }}
312
+ shell : bash
313
+
314
+ - name : Run Tests
315
+ # Run integration tests in a single thread,
316
+ # We end up creating conda envs and running multiple tests in parallel
317
+ # that creat conda envs simultaneously causes issues (sometimes the conda envs do not seem to get created)
318
+ # Similar issues were identified in vscode-jupyter tests as well (something to do with conda lock files or the like)
319
+ run : cargo test --frozen --features ${{ matrix.feature }} -- --nocapture --test-threads=1
320
+ env :
321
+ RUST_BACKTRACE : 1
322
+ RUST_LOG : trace
323
+ shell : bash
324
+
325
+ container-tests :
326
+ # These tests are required as its not easy/possible to use the previous jobs.
327
+ # E.g. we need to test against the jupyter container, as we found some issues specific to that env.
328
+ name : Tests in Containers
329
+ container :
330
+ image : ${{ matrix.image }}
331
+ options : --user=root
332
+ runs-on : ${{ matrix.os }}
333
+ strategy :
334
+ fail-fast : false
335
+ matrix :
336
+ include :
337
+ - feature : ci-jupyter-container
338
+ os : ubuntu-latest
339
+ # For Tests again the container used in https://github.com/github/codespaces-jupyter
340
+ image : mcr.microsoft.com/devcontainers/universal:2.11.1
341
+ target : x86_64-unknown-linux-musl
342
+ - feature : ci-homebrew-container
343
+ os : ubuntu-latest
344
+ # For Homebrew in Ubuntu
345
+ image : homebrew/brew
346
+ target : x86_64-unknown-linux-musl
347
+ steps :
348
+ - name : Checkout
349
+ uses : actions/checkout@v4
350
+
351
+ # Homebrew
352
+ - name : Homebrew Python
353
+ if : startsWith( matrix.image, 'homebrew')
354
+
355
+ shell : bash
356
+
357
+ # Rust
358
+ - name : Rust Tool Chain setup
359
+ uses : dtolnay/rust-toolchain@stable
360
+ with :
361
+ toolchain : stable
362
+ targets : ${{ matrix.target }}
363
+
364
+ - name : Cargo Fetch
365
+ run : cargo fetch
366
+ shell : bash
367
+
368
+ - name : Find Environments
369
+ run : cargo run --release --target ${{ matrix.target }} -- find -v
370
+ shell : bash
371
+
372
+ - name : Run Tests
373
+ run : cargo test --frozen --features ${{ matrix.feature }} -- --nocapture
171
374
shell : bash
172
375
173
376
builds :
0 commit comments