-
Notifications
You must be signed in to change notification settings - Fork 20
259 lines (222 loc) · 6.78 KB
/
test_options.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
name: Test options
on:
push:
branches:
- main
pull_request: null
defaults:
run:
shell: bash -el {0}
jobs:
test_enviroment_file_and_enviroment_name:
name: Test environment-file, environment-name, extra-specs, log-level
timeout-minutes: 10
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
pytest: ["6.1", "6.2"]
steps:
- uses: actions/checkout@v2
- name: install mamba
uses: ./
with:
environment-file: false
environment-name: nofile
- name: install mamba
uses: ./
with:
environment-file: environment.yml
environment-name: myenv
extra-specs: |
pytest=${{ matrix.pytest }}
python=3.8.8
log-level: debug
- name: run python in powershell
shell: powershell
run: |
where micromamba
micromamba info
python -VV
python -c "import numpy"
if: runner.os == 'Windows'
- name: run python in bash
run: |
which micromamba
micromamba info
python -VV
python -c "import numpy"
if: runner.os != 'Windows'
- name: test environment name in powershell
shell: powershell
run: |
python -c "import os; env = os.environ['CONDA_PREFIX'].split('\\')[-1]; assert env == 'myenv'"
if: runner.os == 'Windows'
- name: test environment name in bash
run: |
python -c "import os; env = os.environ['CONDA_PREFIX'].split('/')[-1]; assert env == 'myenv'"
if: runner.os != 'Windows'
- name: check python version in powershell
shell: powershell
run: |
python --version
python -c "import platform; assert platform.python_version() == '3.8.8'"
if: runner.os == 'Windows'
- name: check python version in bash
run: |
python --version
python -c "import platform; assert platform.python_version() == '3.8.8'"
if: runner.os != 'Windows'
- name: check pytest version in powershell
shell: powershell
run: |
pytest --version
python -c "import pytest; assert pytest.__version__.startswith(str(${{ matrix.pytest }}))"
if: runner.os == 'Windows'
- name: check pytest version in bash
run: |
pytest --version
python -c "import pytest; assert pytest.__version__.startswith(str(${{ matrix.pytest }}))"
if: runner.os != 'Windows'
test_channels:
name: Test channels
timeout-minutes: 10
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
environment-file: [false, environment.yml]
steps:
- uses: actions/checkout@v2
- name: install mamba
uses: ./
with:
environment-file: ${{ matrix.environment-file }}
environment-name: test-channels
extra-specs: |
xtensor
channels: conda-forge,blah
test_environment_without_name:
name: "Test environment.yml without name: attribute"
timeout-minutes: 10
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: install mamba
uses: ./
with:
environment-name: noname
environment-file: .github/workflows/resources/environment_without_name.yml
- run: micromamba list -n noname | grep -q xtensor
test_extra_specs:
name: Test extra-specs
timeout-minutes: 10
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v2
- name: install mamba
uses: ./
with:
environment-file: environment.yml
environment-name: myenv
extra-specs: |
click
sel(linux): xtensor
sel(osx): cmake
sel(win): ninja
- name: list environment
run: |
micromamba list
- name: check presence
if: runner.os == 'linux'
run: |
if ! micromamba list | grep -q click; then exit 1; fi
if ! micromamba list | grep -q xtensor; then exit 1; fi
if micromamba list | grep -q cmake; then exit 1; fi
if micromamba list | grep -q ninja; then exit 1; fi
- name: check presence
if: runner.os == 'macos'
run: |
if ! micromamba list | grep -q click; then exit 1; fi
if micromamba list | grep -q xtensor; then exit 1; fi
if ! micromamba list | grep -q cmake; then exit 1; fi
if micromamba list | grep -q ninja; then exit 1; fi
- name: check presence
if: runner.os == 'windows'
run: |
if ! micromamba list | grep -q click; then exit 1; fi
if micromamba list | grep -q xtensor; then exit 1; fi
if micromamba list | grep -q cmake; then exit 1; fi
if ! micromamba list | grep -q ninja; then exit 1; fi
test_channel_priority:
name: Test channel-priority
timeout-minutes: 10
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: install mamba
uses: ./
with:
channel-priority: flexible
environment-file: environment.yml
- name: test
run: |
cat ~/.condarc
grep "channel_priority: flexible" ~/.condarc
test_condarc_file:
name: Test condarc-file
timeout-minutes: 10
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v2
- name: create .condarc
run: |
echo "# sentinel" > mycondarc
- name: install mamba
uses: ./
with:
environment-file: environment.yml
condarc-file: mycondarc
- name: test
run: |
cat ~/.condarc
grep "# sentinel" ~/.condarc
test_condarc_options:
name: Test condarc-options
timeout-minutes: 10
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v2
- name: install mamba
uses: ./
with:
environment-file: environment.yml
condarc-options: |
verify_ssl: false
proxy_servers:
xxx: https://example.com
create_default_packages:
- pip >1
- name: test
run: |
cat ~/.condarc
grep "verify_ssl: false" ~/.condarc
grep "xxx: " ~/.condarc
grep " - pip >1" ~/.condarc