-
Notifications
You must be signed in to change notification settings - Fork 359
239 lines (231 loc) · 8.03 KB
/
windows.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
name: Windows tests
on:
push:
branches:
- main
pull_request:
branches:
- main
paths-ignore:
- 'docs/**'
- '**.md'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
libmamba_tests_win:
name: libmamba tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2019]
steps:
- uses: actions/checkout@v3
- name: Create build environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ./libmamba/environment-dev.yml
environment-name: build_env
cache-environment: true
init-shell: bash cmd.exe
- uses: hendrikmuhs/ccache-action@main
with:
variant: sccache
key: ${{ github.job }}-${{ matrix.os }}
restore-keys: |
libmamba-${{ matrix.os }}
- name: Build libmamba
shell: cmd /C call {0}
run: |
cmake -B build/ ^
-G Ninja ^
-D CMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^
-D CMAKE_BUILD_TYPE="Release" ^
-D BUILD_LIBMAMBA_TESTS=ON ^
-D BUILD_LIBMAMBA=ON ^
-D BUILD_SHARED=ON ^
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache ^
-D CMAKE_C_COMPILER_LAUNCHER=sccache
if %errorlevel% neq 0 exit /b %errorlevel%
cmake --build build/ --parallel --target test_libmamba testing_libmamba_lock
if %errorlevel% neq 0 exit /b %errorlevel%
- name: Run libmamba tests
shell: cmd /C call {0}
run: |
cd build
ninja install
if %errorlevel% neq 0 exit /b %errorlevel%
@REM Interferes with tests
set CONDARC=
ninja test
if %errorlevel% neq 0 exit /b %errorlevel%
- name: Show build cache statistics
run: sccache --show-stats
mamba_python_tests_win:
name: Mamba tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2019]
steps:
- uses: actions/checkout@v3
- name: create build environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ./mamba/environment-dev.yml
environment-name: build_env
cache-environment: true
init-shell: bash cmd.exe
create-args: >-
conda-build
curl
- uses: hendrikmuhs/ccache-action@main
with:
variant: sccache
key: ${{ github.job }}-${{ matrix.os }}
restore-keys: |
libmamba-${{ matrix.os }}
- name: run conda init
shell: bash -l {0}
run: conda init
- name: Build libmambapy
shell: cmd /C call {0}
run: |
cmake -B build/ ^
-G Ninja ^
-D CMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^
-D CMAKE_BUILD_TYPE="Release" ^
-D BUILD_LIBMAMBAPY=ON ^
-D BUILD_LIBMAMBA=ON ^
-D BUILD_SHARED=ON ^
-D BUILD_MAMBA_PACKAGE=ON ^
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache ^
-D CMAKE_C_COMPILER_LAUNCHER=sccache
if %errorlevel% neq 0 exit /b %errorlevel%
cmake --build build/ --parallel
if %errorlevel% neq 0 exit /b %errorlevel%
cmake --install build/
if %errorlevel% neq 0 exit /b %errorlevel%
- name: Install libmambapy
shell: cmd /C call {0}
run: |
pip install -e .\libmambapy\ --no-deps
- name: Show build cache statistics
run: sccache --show-stats
- name: install mamba
shell: bash -l {0}
run: |
python --version
pip install ./mamba[test] --no-deps
- name: Run mamba tests suite
shell: bash -l {0}
run: pytest -v --capture=tee-sys mamba/tests
- name: Run create command
shell: bash -l {0}
run: mamba create -n test_env xtensor -c conda-forge -y
- name: Run env create command
shell: bash -l {0}
run: mamba env create -f mamba/tests/test_env.yml
- name: Run env update command
shell: bash -l {0}
run: mamba env update -f mamba/tests/update_env.yml
- name: Run local channel checks
shell: bash -l {0}
run: |
mkdir -p $CONDA_PREFIX/conda-bld/win-64
echo $PATH
micromamba list
micromamba info
curl --version
curl https://anaconda.org/conda-forge/xtensor/0.21.7/download/win-64/xtensor-0.21.7-h7ef1ec2_0.tar.bz2 -L -o $CONDA_PREFIX/conda-bld/win-64/xtensor-0.21.7-h7ef1ec2_0.tar.bz2
curl https://anaconda.org/conda-forge/xtl/0.6.21/download/win-64/xtl-0.6.21-h5362a0b_0.tar.bz2 -L -o $CONDA_PREFIX/conda-bld/win-64/xtl-0.6.21-h5362a0b_0.tar.bz2
conda index $CONDA_PREFIX/conda-bld
mamba create -n l_o_cal_test xtensor -c local -c conda-forge -y
conda list -n l_o_cal_test
# cut first couple of lines to remove prefix path
conda list -n l_o_cal_test | tail -n +3 > list.txt
if [ "$(grep -c "local" list.txt)" -ne 2 ]; then
exit 1
fi
umamba_build_win:
name: Build micromamba
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2019]
steps:
- uses: actions/checkout@v3
- name: create build environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ./micromamba/environment-dev.yml
environment-name: build_env
cache-environment: true
init-shell: bash cmd.exe
- uses: hendrikmuhs/ccache-action@main
with:
variant: sccache
key: ${{ github.job }}-${{ matrix.os }}
restore-keys: |
libmamba-${{ matrix.os }}
- name: build micromamba
shell: cmd /C call {0}
run: |
cmake -B build/ ^
-G Ninja ^
-D CMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^
-D BUILD_MICROMAMBA=ON ^
-D BUILD_LIBMAMBA=ON ^
-D BUILD_SHARED=ON ^
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache ^
-D CMAKE_C_COMPILER_LAUNCHER=sccache
if %errorlevel% neq 0 exit /b %errorlevel%
cmake --build build/ --parallel
if %errorlevel% neq 0 exit /b %errorlevel%
cmake --install build/
- name: check that micromamba runs
shell: cmd /C call {0}
run: .\build\micromamba\micromamba.exe --help
- name: build cache statistics
run: sccache --show-stats
- name: tar micromamba artifact
shell: cmd /C call {0}
run: |
cp build/libmamba/libmamba.dll build/micromamba/
tar -cvf umamba.tar build/micromamba/micromamba.exe build/micromamba/libmamba.dll
- uses: actions/upload-artifact@v3
with:
name: _internal_micromamba_binary
path: umamba.tar
umamba_integration_tests_win:
name: Micromamba integration tests with PWSH
needs: [umamba_build_win]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2019]
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: _internal_micromamba_binary
- name: untar micromamba artifact
shell: bash -l -eo pipefail {0}
run: |
tar -xvf umamba.tar
- name: create build environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ./micromamba/environment-dev.yml
environment-name: build_env
create-args: menuinst
init-shell: bash cmd.exe powershell
- name: micromamba python based tests with pwsh
shell: pwsh
run: |
$env:PYTHONIOENCODING='UTF-8'
$env:MAMBA_ROOT_PREFIX = Join-Path -Path $pwd -ChildPath 'mambaroot'
$env:TEST_MAMBA_EXE = Join-Path -Path $pwd -ChildPath 'build\micromamba\micromamba.exe'
$env:MAMBA_TEST_SHELL_TYPE='powershell'
Remove-Item -Path "env:CONDARC"
pytest -v --capture=tee-sys micromamba/tests/