-
Notifications
You must be signed in to change notification settings - Fork 359
195 lines (187 loc) · 6.92 KB
/
unix_impl.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
name: Unix tests impl
on:
workflow_call:
inputs:
os:
required: true
type: string
build_type:
required: true
type: string
defaults:
run:
# micromamba activation
shell: bash -l -eo pipefail {0}
jobs:
build_shared_unix:
name: Build binaries
runs-on: ${{ inputs.os }}
steps:
- name: Checkout mamba repository
uses: actions/checkout@v4
- name: Create build environment
uses: mamba-org/setup-micromamba@v2
with:
environment-file: ./dev/environment-dev.yml
environment-name: build_env
cache-environment: true
- uses: hendrikmuhs/ccache-action@main
with:
variant: sccache
key: ${{ github.job }}-${{ inputs.os }}
restore-keys: |
ccache-libmamba-${{ inputs.os }}
- name: Build mamba
run: |
cmake -B build/ -G Ninja \
--preset mamba-unix-shared-${{ inputs.build_type }} \
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache \
-D CMAKE_C_COMPILER_LAUNCHER=sccache \
-D BUILD_LIBMAMBAPY=OFF \
-D ENABLE_MAMBA_ROOT_PREFIX_FALLBACK=OFF
cmake --build build/ --parallel
- name: Show build cache statistics
run: sccache --show-stats
- name: Lock environment
run: micromamba env export --explicit > build/environment.lock
- name: Remove extra files before saving workspace
run: find build/ -type f -name '*.o' -exec rm {} +
- name: Save workspace
uses: ./.github/actions/workspace
with:
action: save
path: build/
key_suffix: ${{ inputs.os }}-${{ inputs.build_type }}
libmamba_tests_unix:
name: libmamba tests
needs: ["build_shared_unix"]
runs-on: ${{ inputs.os }}
steps:
- name: Checkout mamba repository
uses: actions/checkout@v4
- name: Restore workspace
uses: ./.github/actions/workspace
with:
action: restore
path: build/
key_suffix: ${{ inputs.os }}-${{ inputs.build_type }}
- name: Create build environment
uses: mamba-org/setup-micromamba@v2
with:
environment-file: ./build/environment.lock
environment-name: build_env
- name: Run solv-cpp tests
run: |
./build/libmamba/ext/solv-cpp/tests/test_solv_cpp
- name: Run libmamba tests
run: |
unset CONDARC # Interferes with tests
./build/libmamba/tests/test_libmamba
libmambapy_tests_unix:
name: libmambapy tests
needs: ["build_shared_unix"]
runs-on: ${{ inputs.os }}
steps:
- name: Checkout mamba repository
uses: actions/checkout@v4
- name: Restore workspace
uses: ./.github/actions/workspace
with:
action: restore
path: build/
key_suffix: ${{ inputs.os }}-${{ inputs.build_type }}
- name: Create build environment
uses: mamba-org/setup-micromamba@v2
with:
environment-file: ./build/environment.lock
environment-name: build_env
- name: Install libmambapy
run: |
cmake --install build/ --prefix "${CONDA_PREFIX}"
# TODO add some ccache and parallelism to builds
python -m pip install --no-deps --no-build-isolation ./libmambapy
- name: Run libmamba Python bindings tests
run: |
python -m pytest libmambapy/tests/ ${{ runner.debug == 'true' && '-v' || '--exitfirst' }}
mamba_integration_tests_unix:
name: mamba integration tests
needs: ["build_shared_unix"]
runs-on: ${{ inputs.os }}
steps:
- name: Checkout mamba repository
uses: actions/checkout@v4
- name: Restore workspace
uses: ./.github/actions/workspace
with:
action: restore
path: build/
key_suffix: ${{ inputs.os }}-${{ inputs.build_type }}
- name: Create build environment
uses: mamba-org/setup-micromamba@v2
with:
environment-file: ./build/environment.lock
environment-name: build_env
- name: install zsh, xonsh, fish and tcsh in linux
if: startsWith(inputs.os, 'ubuntu')
run: |
sudo apt-get install zsh xonsh fish tcsh -y
- name: Install xonsh and fish in mac
if: startsWith(inputs.os, 'macos')
run: |
brew install fish xonsh
- name: Diagnose CURL/DNS issue
run: |
echo 'ping -c 3 conda.anaconda.org'
ping -c 3 conda.anaconda.org || echo 'FAILED'
echo '--------------------------------------------------'
echo 'ping -c 3 repo.mamba.pm'
ping -c 3 repo.mamba.pm || echo 'FAILED'
echo '--------------------------------------------------'
echo 'nslookup conda.anaconda.org'
nslookup conda.anaconda.org || echo 'FAILED'
echo '--------------------------------------------------'
echo 'nslookup repo.mamba.pm'
nslookup repo.mamba.pm || echo 'FAILED'
echo '--------------------------------------------------'
echo 'which curl'
which curl || echo 'FAILED'
echo '--------------------------------------------------'
echo 'curl -I -vvvv https://conda.anaconda.org/conda-forge/noarch/repodata.json'
curl -I -vvv https://conda.anaconda.org/conda-forge/noarch/repodata.json || echo 'FAILED'
echo '--------------------------------------------------'
echo 'curl -I -vvvv https://repo.mamba.pm/conda-forge/noarch/repodata.json'
curl -I -vvv https://repo.mamba.pm/conda-forge/noarch/repodata.json || echo 'FAILED'
- name: mamba python based tests
run: |
export TEST_MAMBA_EXE=$(pwd)/build/micromamba/mamba
unset CONDARC # Interferes with tests
python -m pytest micromamba/tests/ \
${{ runner.debug == 'true' && '-v --capture=tee-sys' || '--exitfirst' }}
verify_pkg_tests:
name: mamba-content-trust tests
needs: ["build_shared_unix"]
runs-on: ${{ inputs.os }}
if: startsWith(inputs.os, 'ubuntu')
steps:
- name: Checkout mamba repository
uses: actions/checkout@v4
- name: Restore workspace
uses: ./.github/actions/workspace
with:
action: restore
path: build/
key_suffix: ${{ inputs.os }}-${{ inputs.build_type }}
- name: Create build environment
uses: mamba-org/setup-micromamba@v2
with:
environment-file: ./build/environment.lock
environment-name: build_env
- name: Run tests using conda-content-trust (server side)
shell: bash -l {0} -euo pipefail -x
run: |
export TEST_MAMBA_EXE=$(pwd)/build/micromamba/mamba
export MAMBA_ROOT_PREFIX="${HOME}/micromamba"
unset CONDARC # Interferes with tests
cd micromamba/test-server
./generate_gpg_keys.sh
./testserver_pkg_signing.sh