-
Notifications
You must be signed in to change notification settings - Fork 0
760 lines (673 loc) · 29.2 KB
/
tests.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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
name: Tests
on:
# https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#push
push:
branches:
- main
- feature/**
- '[0-9].*.x' # e.g., 4.14.x
- '[0-9][0-9].*.x' # e.g., 23.3.x
# https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request
pull_request:
# https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#workflow_dispatch
workflow_dispatch:
# CONDA-CLASSIC-SOLVER CHANGE
schedule:
- cron: "15 7 * * 1-5" # Mon to Fri, 7:15am
# /CONDA-CLASSIC-SOLVER CHANGE
concurrency:
# Concurrency group that uses the workflow name and PR number if available
# or commit SHA as a fallback. If a new build is triggered under that
# concurrency group while a previous build is running it will be canceled.
# Repeated pushes to a PR will cancel all previous builds, while multiple
# merges to main will not cancel.
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
env:
PYTEST_RERUN_FAILURES: 0
# See https://github.com/conda/conda/pull/13694
# we can't break classic from here; no need to test it
# those tests will still be available for local debugging if necessary
CONDA_TEST_SOLVERS: classic
jobs:
# detect whether any code changes are included in this PR
changes:
runs-on: ubuntu-latest
permissions:
# necessary to detect changes
# https://github.com/dorny/paths-filter#supported-workflows
pull-requests: read
outputs:
code: ${{ steps.filter.outputs.code }}
steps:
- name: Checkout Source
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
# dorny/paths-filter needs git clone for non-PR events
# https://github.com/dorny/paths-filter#supported-workflows
if: github.event_name != 'pull_request'
- name: Filter Changes
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
# CONDA-CLASSIC-SOLVER CHANGE
# changed some paths:
filters: |
code:
- 'conda_classic_solver/**'
- '*.py'
- '.github/workflows/tests.yml'
- 'tests/**'
- 'dev/requirements.txt'
# /CONDA-CLASSIC-SOLVER CHANGE
# windows test suite
windows:
# only run test suite if there are code changes
needs: changes
if: needs.changes.outputs.code == 'true'
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
# test lower version (w/ defaults) and upper version (w/ defaults and conda-forge)
python-version: ['3.8', '3.11', '3.12'] # CONDA-CLASSIC-SOLVER CHANGE
default-channel: [defaults, conda-forge]
test-type: [conda-classic-solver, unit, integration] # CONDA-CLASSIC-SOLVER CHANGE
test-group: [1, 2, 3]
exclude:
- default-channel: conda-forge
python-version: '3.8'
- default-channel: defaults # CONDA-CLASSIC-SOLVER CHANGE
python-version: '3.11' # CONDA-CLASSIC-SOLVER CHANGE
- default-channel: conda-forge # CONDA-CLASSIC-SOLVER CHANGE
python-version: '3.12' # CONDA-CLASSIC-SOLVER CHANGE
- test-type: unit
test-group: 3
- test-type: conda-classic-solver # CONDA-CLASSIC-SOLVER CHANGE
test-group: 2 # CONDA-CLASSIC-SOLVER CHANGE
- test-type: conda-classic-solver # CONDA-CLASSIC-SOLVER CHANGE
test-group: 3 # CONDA-CLASSIC-SOLVER CHANGE
env:
ErrorActionPreference: Stop # powershell exit immediately on error
PYTEST_MARKER: ${{ matrix.test-type == 'unit' && 'not integration' || 'integration' }}
PYTEST_SPLITS: ${{ matrix.test-type == 'unit' && '2' || '3' }}
REQUIREMENTS_TRUSTSTORE: ${{ contains('3.10|3.11|3.12', matrix.python-version) && '--file tests\requirements-truststore.txt' || '' }}
steps:
- name: Checkout conda/conda # CONDA-CLASSIC-SOLVER CHANGE
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
repository: conda/conda # CONDA-CLASSIC-SOLVER CHANGE
ref: remove-classic # TEMPORARY
path: conda # CONDA-CLASSIC-SOLVER CHANGE
# CONDA-CLASSIC-SOLVER CHANGE
- name: Checkout conda-classic-solver
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
path: conda-classic-solver
# /CONDA-CLASSIC-SOLVER CHANGE
- name: Hash + Timestamp
shell: bash # use bash to run date command
run: echo "HASH=${{ runner.os }}-${{ runner.arch }}-Py${{ matrix.python-version }}-${{ matrix.default-channel }}-${{ matrix.test-type }}-${{ matrix.test-group }}-$(date -u "+%Y%m")" >> $GITHUB_ENV
- name: Cache Conda
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/conda_pkgs_dir
key: cache-${{ env.HASH }}
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4
with:
# CONDA-CLASSIC-SOLVER CHANGE: add conda\
condarc-file: conda\.github\condarc-${{ matrix.default-channel }}
run-post: false # skip post cleanup
- name: Conda Install
working-directory: conda # CONDA-CLASSIC-SOLVER CHANGE
# CONDA-CLASSIC-SOLVER CHANGE: add conda-classic-solver requirements.txt
run: >
conda install
--yes
--file tests\requirements.txt
--file tests\requirements-${{ runner.os }}.txt
--file tests\requirements-ci.txt
--file tests\requirements-s3.txt
--file ..\conda-classic-solver\dev\requirements.txt
--file ..\conda-classic-solver\tests\requirements.txt
${{ env.REQUIREMENTS_TRUSTSTORE }}
python=${{ matrix.python-version }}
# CONDA-CLASSIC-SOLVER CHANGE
- name: Install conda-classic-solver
run: python -m pip install -e conda-classic-solver/ -vv --no-deps
#/ CONDA-CLASSIC-SOLVER CHANGE
- name: Conda Info
run: python -m conda info --verbose
- name: Conda Config
run: conda config --show-sources
- name: Conda List
run: conda list --show-channel-urls
- name: Run Tests
working-directory: conda # CONDA-CLASSIC-SOLVER CHANGE
if: ${{ matrix.test-type != 'conda-classic-solver' }} # CONDA-CLASSIC-SOLVER CHANGE
run: python -m pytest
--cov=conda
--durations-path=durations\${{ runner.os }}.json
--group=${{ matrix.test-group }}
--splits=${{ env.PYTEST_SPLITS }}
--reruns=${{ env.PYTEST_RERUN_FAILURES }}
-m "${{ env.PYTEST_MARKER }}"
# CONDA-CLASSIC-SOLVER CHANGE
- name: Run conda-classic-solver Tests
working-directory: conda-classic-solver
if: ${{ matrix.test-type == 'conda-classic-solver' }}
shell: cmd /C CALL {0}
run: |
CALL python -m pip install -e ../conda/ --no-deps
if errorlevel 1 exit 1
CALL python -m conda init --all
if errorlevel 1 exit 1
CALL %CONDA_PREFIX%\Scripts\activate.bat
if errorlevel 1 exit 1
python -m pytest -vv -m "not slow" --reruns=${{ env.PYTEST_RERUN_FAILURES }} --durations=16 || exit 1
exit 0
#/ CONDA-CLASSIC-SOLVER CHANGE
- name: Upload Coverage
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
if: false # CONDA-CLASSIC-SOLVER CHANGE
with:
flags: ${{ runner.os }},${{ runner.arch }},${{ matrix.python-version }},${{ matrix.test-type }}
- name: Upload Test Results
if: '!cancelled()'
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
name: test-results-${{ env.HASH }}
# CONDA-CLASSIC-SOLVER CHANGE: need to prepend conda/ to the paths
path: |
conda\.coverage
conda\durations\${{ runner.os }}.json
conda\test-report.xml
retention-days: 1 # temporary, combined in aggregate below
# linux test suite
linux:
# only run test suite if there are code changes
needs: changes
if: needs.changes.outputs.code == 'true'
runs-on: ubuntu-latest
defaults:
run:
# https://github.com/conda-incubator/setup-miniconda#use-a-default-shell
shell: bash -el {0} # bash exit immediately on error + login shell
strategy:
fail-fast: false
matrix:
# test all lower versions (w/ defaults) and upper version (w/ defaults and conda-forge)
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
default-channel: [defaults, conda-forge]
test-type: [conda-classic-solver, unit, integration] # CONDA-CLASSIC-SOLVER CHANGE
test-group: [1, 2, 3]
exclude:
- python-version: '3.8'
default-channel: conda-forge
- python-version: '3.9'
default-channel: conda-forge
- python-version: '3.10'
default-channel: conda-forge
- python-version: '3.11' # CONDA-CLASSIC-SOLVER CHANGE
default-channel: defaults # CONDA-CLASSIC-SOLVER CHANGE
- python-version: '3.12'
default-channel: conda-forge
- test-type: unit
test-group: 3
- test-type: conda-classic-solver # CONDA-CLASSIC-SOLVER CHANGE
test-group: 2 # CONDA-CLASSIC-SOLVER CHANGE
- test-type: conda-classic-solver # CONDA-CLASSIC-SOLVER CHANGE
test-group: 3 # CONDA-CLASSIC-SOLVER CHANGE
env:
PYTEST_MARKER: ${{ matrix.test-type == 'unit' && 'not integration' || 'integration' }}
PYTEST_SPLITS: ${{ matrix.test-type == 'unit' && '2' || '3' }}
REQUIREMENTS_TRUSTSTORE: ${{ contains('3.10|3.11|3.12', matrix.python-version) && '--file tests/requirements-truststore.txt' || '' }}
steps:
- name: Checkout conda/conda # CONDA-CLASSIC-SOLVER CHANGE
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
repository: conda/conda # CONDA-CLASSIC-SOLVER CHANGE
ref: remove-classic # TEMPORARY
path: conda # CONDA-CLASSIC-SOLVER CHANGE
# CONDA-CLASSIC-SOLVER CHANGE
- name: Checkout conda-classic-solver
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
path: conda-classic-solver
# /CONDA-CLASSIC-SOLVER CHANGE
- name: Hash + Timestamp
run: echo "HASH=${{ runner.os }}-${{ runner.arch }}-Py${{ matrix.python-version }}-${{ matrix.default-channel }}-${{ matrix.test-type }}-${{ matrix.test-group }}-$(date -u "+%Y%m")" >> $GITHUB_ENV
- name: Cache Conda
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/conda_pkgs_dir
key: cache-${{ env.HASH }}
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4
with:
# CONDA-CLASSIC-SOLVER CHANGE: add conda/
condarc-file: conda/.github/condarc-${{ matrix.default-channel }}
run-post: false # skip post cleanup
- name: Conda Install
working-directory: conda
run: >
conda install
--yes
--file tests/requirements.txt
--file tests/requirements-${{ runner.os }}.txt
--file tests/requirements-ci.txt
--file tests/requirements-s3.txt
--file ../conda-classic-solver/dev/requirements.txt
--file ../conda-classic-solver/tests/requirements.txt
${{ env.REQUIREMENTS_TRUSTSTORE }}
python=${{ matrix.python-version }}
# CONDA-CLASSIC-SOLVER CHANGE
- name: Install conda-classic-solver
run: python -m pip install -e conda-classic-solver/ -vv --no-deps
#/ CONDA-CLASSIC-SOLVER CHANGE
- name: Conda Info
run: python -m conda info --verbose
- name: Conda Config
run: conda config --show-sources
- name: Conda List
run: conda list --show-channel-urls
- name: Run Tests
working-directory: conda # CONDA-CLASSIC-SOLVER CHANGE
if: ${{ matrix.test-type != 'conda-classic-solver' }} # CONDA-CLASSIC-SOLVER CHANGE
run: python -m pytest
--cov=conda
--durations-path=durations/${{ runner.os }}.json
--group=${{ matrix.test-group }}
--splits=${{ env.PYTEST_SPLITS }}
--reruns=${{ env.PYTEST_RERUN_FAILURES }}
-m "${{ env.PYTEST_MARKER }}"
# CONDA-CLASSIC-SOLVER CHANGE
- name: Run conda-classic-solver Tests
working-directory: conda-classic-solver
if: ${{ matrix.test-type == 'conda-classic-solver' }}
run: |
python -m pip install -e ../conda/ --no-deps
python -m conda init --all
. $CONDA_PREFIX/etc/profile.d/conda.sh
python -m pytest -vv -m "not slow" --reruns=${{ env.PYTEST_RERUN_FAILURES }} --durations=16
#/ CONDA-CLASSIC-SOLVER CHANGE
- name: Upload Coverage
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
if: false # CONDA-CLASSIC-SOLVER CHANGE
with:
flags: ${{ runner.os }},${{ runner.arch }},${{ matrix.python-version }},${{ matrix.test-type }}
- name: Upload Test Results
if: '!cancelled()'
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
name: test-results-${{ env.HASH }}
path: |
conda/.coverage
conda/durations/${{ runner.os }}.json
conda/test-report.xml
retention-days: 1 # temporary, combined in aggregate below
# linux benchmarks
linux-benchmarks:
# only run test suite if there are code changes
# CONDA-CLASSIC-SOLVER CHANGE
# needs: changes
if: false
# needs.changes.outputs.code == 'true'
#/ CONDA-CLASSIC-SOLVER CHANGE
runs-on: ubuntu-latest
defaults:
run:
# https://github.com/conda-incubator/setup-miniconda#use-a-default-shell
shell: bash -el {0} # bash exit immediately on error + login shell
strategy:
fail-fast: false
matrix:
python-version: ['3.12']
env:
REQUIREMENTS_TRUSTSTORE: ${{ contains('3.10|3.11|3.12', matrix.python-version) && '--file tests/requirements-truststore.txt' || '' }}
steps:
- name: Checkout Source
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: Hash + Timestamp
run: echo "HASH=${{ runner.os }}-${{ runner.arch }}-Py${{ matrix.python-version }}-benchmark-$(date -u "+%Y%m")" >> $GITHUB_ENV
- name: Cache Conda
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/conda_pkgs_dir
key: cache-${{ env.HASH }}
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4
with:
condarc-file: .github/condarc-defaults
run-post: false # skip post cleanup
- name: Conda Install
run: conda install
--yes
--file tests/requirements.txt
--file tests/requirements-${{ runner.os }}.txt
--file tests/requirements-ci.txt
--file tests/requirements-s3.txt
${{ env.REQUIREMENTS_TRUSTSTORE }}
python=${{ matrix.python-version }}
- name: Install CodSpeed
run: pip install git+https://github.com/kenodegard/pytest-codspeed.git@fix-outerr-redirects#egg=pytest-codspeed
- name: Conda Info
run: python -m conda info --verbose
- name: Conda Config
run: conda config --show-sources
- name: Conda List
run: conda list --show-channel-urls
- name: Run Benchmarks
uses: CodSpeedHQ/action@ab07afd34cbbb7a1306e8d14b7cc44e029eee37a # v3.0.0
with:
token: ${{ secrets.CODSPEED_TOKEN }}
run: $CONDA/envs/test/bin/pytest --codspeed
# linux-qemu test suite
linux-qemu:
# only run test suite if there are code changes
# CONDA-CLASSIC-SOLVER CHANGE
# needs: changes
if: false
# needs.changes.outputs.code == 'true'
#/ CONDA-CLASSIC-SOLVER CHANGE
# Run one single fast test per docker+qemu emulated linux platform to test that
# test execution is possible there (container+tools+dependencies work). Can be
# changed / extended to run specific tests in case there are platform related
# things to test. Running more tests is time consuming due to emulation
# (factor 2-10x slower).
runs-on: ubuntu-latest
defaults:
run:
# https://github.com/conda-incubator/setup-miniconda#use-a-default-shell
shell: bash -el {0} # bash exit immediately on error + login shell
strategy:
fail-fast: false
matrix:
python-version: ['3.12']
image: ['continuumio/miniconda3:latest', 'condaforge/miniforge3:latest']
platform: [arm64, ppc64le, s390x]
exclude:
- image: 'continuumio/miniconda3:latest'
platform: ppc64le
- image: 'condaforge/miniforge3:latest'
platform: s390x
steps:
- name: Checkout Source
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: Setup QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
- name: Run Tests
run: docker run
--rm
--volume ${PWD}:/opt/conda-src
--workdir /opt/conda-src
--platform linux/${{ matrix.platform }}
${{ matrix.image }}
bash -lc
". /opt/conda/etc/profile.d/conda.sh
&& set -x
&& conda create
--name test
--yes
--file tests/requirements.txt
--file tests/requirements-${{ runner.os }}.txt
--file tests/requirements-ci.txt
python=${{ matrix.python-version }}
&& conda activate test
&& python -m conda info --verbose
&& conda config --show-sources
&& conda list --show-channel-urls
&& python -m pytest tests/test_api.py::test_DepsModifier_contract"
# macos test suite
macos:
# only run test suite if there are code changes
needs: changes
if: needs.changes.outputs.code == 'true'
runs-on: ${{ (matrix.arch == 'osx-64' && 'macos-13') || 'macos-14' }}
defaults:
run:
# https://github.com/conda-incubator/setup-miniconda#use-a-default-shell
shell: bash -el {0} # bash exit immediately on error + login shell
strategy:
fail-fast: false
matrix:
# test lower version (w/ osx-64 & defaults & unit tests) and upper version (w/ osx-arm64 & conda-forge & integration tests)
arch: [osx-64, osx-arm64]
python-version: ['3.8', '3.11']
default-channel: [defaults, conda-forge]
test-type: [conda-classic-solver, unit, integration] # CONDA-CLASSIC-SOLVER CHANGE
test-group: [1, 2, 3]
exclude:
- arch: osx-64
python-version: '3.11'
- arch: osx-64
default-channel: conda-forge
- arch: osx-64
test-type: integration
- arch: osx-arm64
python-version: '3.8'
- arch: osx-arm64
default-channel: defaults
- arch: osx-arm64
test-type: unit
- arch: osx-arm64 # CONDA-CLASSIC-SOLVER CHANGE
test-type: conda-classic-solver # CONDA-CLASSIC-SOLVER CHANGE
- test-type: unit
test-group: 3
- test-type: conda-classic-solver # CONDA-CLASSIC-SOLVER CHANGE
test-group: 2 # CONDA-CLASSIC-SOLVER CHANGE
- test-type: conda-classic-solver # CONDA-CLASSIC-SOLVER CHANGE
test-group: 3 # CONDA-CLASSIC-SOLVER CHANGE
env:
PYTEST_MARKER: ${{ matrix.test-type == 'unit' && 'not integration' || 'integration' }}
PYTEST_SPLITS: ${{ matrix.test-type == 'unit' && '2' || '3' }}
REQUIREMENTS_TRUSTSTORE: ${{ contains('3.10|3.11|3.12', matrix.python-version) && '--file tests/requirements-truststore.txt' || '' }}
steps:
- name: Checkout conda/conda # CONDA-CLASSIC-SOLVER CHANGE
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
repository: conda/conda # CONDA-CLASSIC-SOLVER CHANGE
ref: remove-classic # TEMPORARY
path: conda # CONDA-CLASSIC-SOLVER CHANGE
# CONDA-CLASSIC-SOLVER CHANGE
- name: Checkout conda-classic-solver
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
path: conda-classic-solver
# /CONDA-CLASSIC-SOLVER CHANGE
- name: Hash + Timestamp
run: echo "HASH=${{ runner.os }}-${{ runner.arch }}-Py${{ matrix.python-version }}-${{ matrix.default-channel }}-${{ matrix.test-type }}-${{ matrix.test-group }}-$(date -u "+%Y%m")" >> $GITHUB_ENV
- name: Cache Conda
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/conda_pkgs_dir
key: cache-${{ env.HASH }}
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4
with:
# CONDA-CLASSIC-SOLVER CHANGE: add conda/
condarc-file: conda/.github/condarc-${{ matrix.default-channel }}
run-post: false # skip post cleanup
# conda not preinstalled in arm64 runners
miniconda-version: ${{ (matrix.default-channel == 'defaults' && matrix.arch == 'osx-arm64') && 'latest' || null }}
miniforge-version: ${{ (matrix.default-channel == 'conda-forge' && matrix.arch == 'osx-arm64') && 'latest' || null }}
architecture: ${{ runner.arch }}
- name: Conda Install
working-directory: conda # CONDA-CLASSIC-SOLVER CHANGE
# CONDA-CLASSIC-SOLVER CHANGE: add conda-classic-solver requirements.txt
run: >
conda install
--yes
--file tests/requirements.txt
--file tests/requirements-ci.txt
--file tests/requirements-s3.txt
--file ../conda-classic-solver/dev/requirements.txt
--file ../conda-classic-solver/tests/requirements.txt
${{ env.REQUIREMENTS_TRUSTSTORE }}
python=${{ matrix.python-version }}
# CONDA-CLASSIC-SOLVER CHANGE
- name: Install conda-classic-solver
run: python -m pip install -e conda-classic-solver/ -vv --no-deps
#/ CONDA-CLASSIC-SOLVER CHANGE
- name: Conda Info
run: python -m conda info --verbose
- name: Conda Config
run: conda config --show-sources
- name: Conda List
run: conda list --show-channel-urls
- name: Run Tests
working-directory: conda # CONDA-CLASSIC-SOLVER CHANGE
if: ${{ matrix.test-type != 'conda-classic-solver' }} # CONDA-CLASSIC-SOLVER CHANGE
run: python -m pytest
--cov=conda
--durations-path=durations/${{ runner.os }}.json
--group=${{ matrix.test-group }}
--splits=${{ env.PYTEST_SPLITS }}
--reruns=${{ env.PYTEST_RERUN_FAILURES }}
-m "${{ env.PYTEST_MARKER }}"
# CONDA-CLASSIC-SOLVER CHANGE
- name: Run conda-classic-solver Tests
working-directory: conda-classic-solver
if: ${{ matrix.test-type == 'conda-classic-solver' }}
run: |
python -m pip install -e ../conda/ --no-deps
python -m conda init --all
. $CONDA_PREFIX/etc/profile.d/conda.sh
python -m pytest -vv -m "not slow" --reruns=${{ env.PYTEST_RERUN_FAILURES }} --durations=16
#/ CONDA-CLASSIC-SOLVER CHANGE
- name: Upload Coverage
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
if: false # CONDA-CLASSIC-SOLVER CHANGE
with:
flags: ${{ runner.os }},${{ runner.arch }},${{ matrix.python-version }},${{ matrix.test-type }}
- name: Upload Test Results
if: '!cancelled()'
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
name: test-results-${{ env.HASH }}
# CONDA-CLASSIC-SOLVER CHANGE: need to prepend conda/ to the paths
path: |
conda/.coverage
conda/durations/${{ runner.os }}.json
conda/test-report.xml
retention-days: 1 # temporary, combined in aggregate below
# aggregate and upload
aggregate:
# only aggregate test suite if there are code changes
needs: [changes, windows, linux, linux-benchmarks, linux-qemu, macos]
if: >-
!cancelled()
&& needs.changes.outputs.code == 'true'
runs-on: ubuntu-latest
steps:
- name: Download Artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
- name: Upload Combined Test Results
# provides one downloadable archive of all matrix run test results for further analysis
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
name: test-results-${{ github.sha }}-all
path: test-results-*
retention-days: 7 # for durations.yml workflow
- name: Test Summary
uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86 # v2.4
with:
paths: test-results-*/test-report.xml
# required check
analyze:
needs: [windows, linux, linux-qemu, linux-benchmarks, macos, aggregate]
if: '!cancelled()'
runs-on: ubuntu-latest
steps:
- name: Determine Success
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
id: alls-green # CONDA-CLASSIC-SOLVER CHANGE
with:
# permit jobs to be skipped if there are no code changes (see changes job)
allowed-skips: ${{ toJSON(needs) }}
jobs: ${{ toJSON(needs) }}
# CONDA-CLASSIC-SOLVER CHANGE
- name: Checkout our source
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
if: always() && github.event_name == 'schedule' && steps.alls-green.outputs.result == 'failure'
- name: Report failures
if: always() && github.event_name == 'schedule' && steps.alls-green.outputs.result == 'failure'
uses: JasonEtco/create-an-issue@1b14a70e4d8dc185e5cc76d3bec9eab20257b2c5 # v2.9.2
env:
GITHUB_TOKEN: ${{ secrets.CONDA_CLASSIC_SOLVER_ISSUES }}
RUN_ID: ${{ github.run_id }}
TITLE: "Scheduled tests failed"
with:
filename: .github/TEST_FAILURE_REPORT_TEMPLATE.md
update_existing: true
# /CONDA-CLASSIC-SOLVER CHANGE
# canary builds
build:
name: Build canary
needs: [analyze]
# only build canary build if
# - prior steps succeeded,
# - this is the main repo, and
# - we are on the main, feature, or release branch
if: >-
!cancelled()
&& !github.event.repository.fork
&& (
github.ref_name == 'main'
|| startsWith(github.ref_name, 'feature/')
|| endsWith(github.ref_name, '.x')
)
runs-on: ubuntu-latest
steps:
# Clean checkout of specific git ref needed for package metadata version
# which needs env vars GIT_DESCRIBE_TAG and GIT_BUILD_STR:
- name: Checkout Source
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: ${{ github.ref }}
clean: true
fetch-depth: 0
# Explicitly use Python 3.11 since each of the OSes has a different default Python
- name: Setup Python
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
with:
python-version: '3.11'
- name: Detect Label
shell: python
run: |
from pathlib import Path
from re import match
from os import environ
if "${{ github.ref_name }}" == "main":
# main branch commits are uploaded to the dev label
label = "dev"
elif "${{ github.ref_name }}".startswith("feature/"):
# feature branch commits are uploaded to a custom label
label = "${{ github.ref_name }}"
else:
# release branch commits are added to the rc label
# see https://github.com/conda/infrastructure/issues/760
_, name = "${{ github.repository }}".split("/")
label = f"rc-{name}-${{ github.ref_name }}"
Path(environ["GITHUB_ENV"]).write_text(f"ANACONDA_ORG_LABEL={label}")
- name: Create & Upload
uses: conda/actions/canary-release@v24.5.0
env:
# Run conda-build in isolated activation to properly package conda
_CONDA_BUILD_ISOLATED_ACTIVATION: 1
with:
package-name: ${{ github.event.repository.name }}
subdir: noarch
anaconda-org-channel: conda-canary
anaconda-org-label: ${{ env.ANACONDA_ORG_LABEL }}
anaconda-org-token: ${{ secrets.ANACONDA_ORG_CONDA_CANARY_TOKEN }}