11---
22name : main
3- # Automatically cancel a previous run.
43concurrency :
54 group : ${{ github.head_ref || github.run_id }}
65 cancel-in-progress : true
1312 - ' *'
1413jobs :
1514 run-tests-linux :
16- name : Run tests for ${{ matrix.os }} on ${{ matrix.python-version }}
17- runs-on : ${{ matrix.os }}
15+ name : Run tests on ubuntu-latest py ${{ matrix.python-version }}
16+ runs-on : ubuntu-latest
1817 strategy :
1918 fail-fast : false
2019 matrix :
21- os :
22- - ubuntu-latest
2320 python-version :
24- - ' 3.10 '
25- - ' 3.11 '
26- - ' 3.12 '
27- - ' 3.13 '
21+ - ' 310 '
22+ - ' 311 '
23+ - ' 312 '
24+ - ' 313 '
2825 steps :
2926 - uses : actions/checkout@v4
30- - name : create build environment
31- uses : mamba-org/setup-micromamba@v1
27+ - uses : prefix-dev/setup-pixi@v0.9.4
3228 with :
33- environment-file : ./.tools/envs/testenv-linux.yml
34- cache-environment : true
35- create-args : |
36- python=${{ matrix.python-version }}
37- - name : run pytest
38- shell : bash -l {0}
39- run : |
40- micromamba activate optimagic
41- pytest --cov-report=xml --cov=./
29+ pixi-version : v0.65.0
30+ cache : true
31+ cache-write : ${{ github.event_name == 'push' && github.ref_name == 'main' }}
32+ frozen : true
33+ environments : test-linux-py${{ matrix.python-version }}
34+ - name : Run pytest
35+ shell : bash -el {0}
36+ run : pixi run -e test-linux-py${{ matrix.python-version }} tests-with-cov
4237 - name : Upload coverage report.
43- if : runner.os == 'Linux' && matrix.python-version == '3.10 '
38+ if : matrix.python-version == '310 '
4439 uses : codecov/codecov-action@v4
4540 with :
4641 token : ${{ secrets.CODECOV_TOKEN }}
4742 run-tests-win-and-mac :
48- name : Run tests for ${{ matrix.os }} on ${{ matrix.python-version }}
43+ name : Run tests on ${{ matrix.os }} py ${{ matrix.python-version }}
4944 runs-on : ${{ matrix.os }}
5045 strategy :
5146 fail-fast : false
@@ -54,163 +49,121 @@ jobs:
5449 - macos-latest
5550 - windows-latest
5651 python-version :
57- - ' 3.10 '
58- - ' 3.11 '
59- - ' 3.12 '
60- - ' 3.13 '
52+ - ' 310 '
53+ - ' 311 '
54+ - ' 312 '
55+ - ' 313 '
6156 steps :
6257 - uses : actions/checkout@v4
63- - name : create build environment
64- uses : mamba-org/setup-micromamba@v1
58+ - uses : prefix-dev/setup-pixi@v0.9.4
6559 with :
66- micromamba-version : 1.5.6-0
67- environment-file : ./.tools/envs/testenv-others.yml
68- cache-environment : true
69- create-args : |
70- python=${{ matrix.python-version }}
71- - name : run pytest
72- shell : bash -l {0}
73- run : |
74- micromamba activate optimagic
75- pytest -m "not slow and not jax"
60+ pixi-version : v0.65.0
61+ cache : true
62+ cache-write : ${{ github.event_name == 'push' && github.ref_name == 'main' }}
63+ frozen : true
64+ environments : test-py${{ matrix.python-version }}
65+ - name : Run pytest
66+ shell : bash -el {0}
67+ run : pixi run -e test-py${{ matrix.python-version }} tests-fast
7668 run-tests-with-old-pandas :
77- # This job is only for testing if optimagic works with pandas<2, as many pandas
78- # functions we use will be deprecated in pandas 3. optimagic's behavior for older
79- # verions is handled in src/optimagic/compat.py. For compatibility with we have to
80- # restrict numpy<2.
81- name : Run tests for ${{ matrix.os}} on ${{ matrix.python-version }} with pandas 1
82- runs-on : ${{ matrix.os }}
83- strategy :
84- fail-fast : false
85- matrix :
86- os :
87- - ubuntu-latest
88- python-version :
89- - ' 3.10'
69+ name : Run tests on ubuntu-latest with pandas < 2
70+ runs-on : ubuntu-latest
9071 steps :
9172 - uses : actions/checkout@v4
92- - name : create build environment
93- uses : mamba-org/setup-micromamba@v1
73+ - uses : prefix-dev/setup-pixi@v0.9.4
9474 with :
95- environment-file : ./.tools/envs/testenv-pandas.yml
96- cache-environment : true
97- create-args : |
98- python=${{ matrix.python-version }}
99- - name : run pytest
100- shell : bash -l {0}
101- run : |
102- micromamba activate optimagic
103- pytest -m "not slow and not jax"
75+ pixi-version : v0.65.0
76+ cache : true
77+ cache-write : ${{ github.event_name == 'push' && github.ref_name == 'main' }}
78+ frozen : true
79+ environments : test-old-pandas
80+ - name : Run pytest
81+ shell : bash -el {0}
82+ run : pixi run -e test-old-pandas tests-fast
10483 run-tests-with-old-numpy :
105- # This job is only for testing if optimagic works with numpy<2. Because we already
106- # test pandas<2 with numpy<2, in this environment we restrict pandas>=2.
107- name : Run tests for ${{ matrix.os}} on ${{ matrix.python-version }} with numpy 1
108- runs-on : ${{ matrix.os }}
109- strategy :
110- fail-fast : false
111- matrix :
112- os :
113- - ubuntu-latest
114- python-version :
115- - ' 3.10'
84+ name : Run tests on ubuntu-latest with numpy < 2
85+ runs-on : ubuntu-latest
11686 steps :
11787 - uses : actions/checkout@v4
118- - name : create build environment
119- uses : mamba-org/setup-micromamba@v1
88+ - uses : prefix-dev/setup-pixi@v0.9.4
12089 with :
121- environment-file : ./.tools/envs/testenv-numpy.yml
122- cache-environment : true
123- create-args : |
124- python=${{ matrix.python-version }}
125- - name : run pytest
126- shell : bash -l {0}
127- run : |
128- micromamba activate optimagic
129- pytest -m "not slow and not jax"
90+ pixi-version : v0.65.0
91+ cache : true
92+ cache-write : ${{ github.event_name == 'push' && github.ref_name == 'main' }}
93+ frozen : true
94+ environments : test-old-numpy
95+ - name : Run pytest
96+ shell : bash -el {0}
97+ run : pixi run -e test-old-numpy tests-fast
13098 run-tests-with-old-plotly :
131- name : Run tests for ubuntu-latest on 3.10 with plotly < 6 and kaleido < 0.3
99+ name : Run tests on ubuntu-latest with plotly < 6
132100 runs-on : ubuntu-latest
133- strategy :
134- fail-fast : false
135101 steps :
136102 - uses : actions/checkout@v4
137- - name : create build environment
138- uses : mamba-org/setup-micromamba@v1
103+ - uses : prefix-dev/setup-pixi@v0.9.4
139104 with :
140- environment-file : ./.tools/envs/testenv-plotly.yml
141- cache-environment : true
142- create-args : |
143- python=3.10
144- - name : run pytest
145- shell : bash -l {0}
146- run : |
147- micromamba activate optimagic
148- pytest -m "not slow and not jax"
105+ pixi-version : v0.65.0
106+ cache : true
107+ cache-write : ${{ github.event_name == 'push' && github.ref_name == 'main' }}
108+ frozen : true
109+ environments : test-old-plotly
110+ - name : Run pytest
111+ shell : bash -el {0}
112+ run : pixi run -e test-old-plotly tests-fast
149113 run-tests-nevergrad :
150- # This job is for running test related to nevergrad with pinned version of
151- # bayesian_optimization == 1.4.0
152- name : Run tests for ubuntu-latest on ${{ matrix.python-version }} bayes_opt==1.4.0
153- runs-on : ${{ matrix.os }}
114+ name : Run nevergrad tests py${{ matrix.python-version }}
115+ runs-on : ubuntu-latest
154116 strategy :
155117 fail-fast : false
156118 matrix :
157- os :
158- - ubuntu-latest
159119 python-version :
160- - ' 3.10 '
161- - ' 3.11 '
162- - ' 3.12 '
163- - ' 3.13 '
120+ - ' 310 '
121+ - ' 311 '
122+ - ' 312 '
123+ - ' 313 '
164124 steps :
165125 - uses : actions/checkout@v4
166- - name : create build environment
167- uses : mamba-org/setup-micromamba@v1
126+ - uses : prefix-dev/setup-pixi@v0.9.4
168127 with :
169- environment-file : ./.tools/envs/testenv-nevergrad.yml
170- cache-environment : true
171- create-args : |
172- python=${{ matrix.python-version }}
173- - name : run pytest
174- shell : bash -l {0}
175- run : |
176- micromamba activate optimagic
128+ pixi-version : v0.65.0
129+ cache : true
130+ cache-write : ${{ github.event_name == 'push' && github.ref_name == 'main' }}
131+ frozen : true
132+ environments : test-nevergrad-py${{ matrix.python-version }}
133+ - name : Run pytest
134+ shell : bash -el {0}
135+ run : >-
136+ pixi run -e test-nevergrad-py${{ matrix.python-version }}
177137 pytest tests/optimagic/optimizers/test_nevergrad.py
178138 code-in-docs :
179139 name : Run code snippets in documentation
180140 runs-on : ubuntu-latest
181141 steps :
182142 - uses : actions/checkout@v4
183- - name : create build environment
184- uses : mamba-org/setup-micromamba@v1
143+ - uses : prefix-dev/setup-pixi@v0.9.4
185144 with :
186- environment-file : ./.tools/envs/testenv-linux.yml
187- environment-name : optimagic
188- cache-environment : true
189- create-args : |
190- python=3.12
191- - name : run sphinx
192- shell : bash -l {0}
193- run : |-
194- micromamba activate optimagic
195- cd docs/source
196- python -m doctest -v how_to/how_to_constraints.md
145+ pixi-version : v0.65.0
146+ cache : true
147+ cache-write : ${{ github.event_name == 'push' && github.ref_name == 'main' }}
148+ frozen : true
149+ environments : test-linux-py312
150+ - name : Run doctest
151+ shell : bash -el {0}
152+ run : >-
153+ pixi run -e test-linux-py312
154+ python -m doctest -v docs/source/how_to/how_to_constraints.md
197155 run-mypy :
198156 name : Run mypy
199157 runs-on : ubuntu-latest
200- strategy :
201- fail-fast : false
202158 steps :
203159 - uses : actions/checkout@v4
204- - name : create build environment
205- uses : mamba-org/setup-micromamba@v1
160+ - uses : prefix-dev/setup-pixi@v0.9.4
206161 with :
207- environment-file : ./.tools/envs/testenv-linux.yml
208- environment-name : optimagic
209- cache-environment : true
210- create-args : |
211- python=3.10
162+ pixi-version : v0.65.0
163+ cache : true
164+ cache-write : ${{ github.event_name == 'push' && github.ref_name == 'main' }}
165+ frozen : true
166+ environments : test-linux-py310
212167 - name : Run mypy
213- shell : bash -l {0}
214- run : |-
215- micromamba activate optimagic
216- mypy
168+ shell : bash -el {0}
169+ run : pixi run -e test-linux-py310 mypy
0 commit comments