-
Notifications
You must be signed in to change notification settings - Fork 359
211 lines (204 loc) · 8.52 KB
/
static_build.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
name: Micromamba
on:
push:
branches:
- main
pull_request:
branches:
- main
paths-ignore:
- 'docs/**'
- 'mamba/**'
- 'libmambapy/**'
- '**.md'
merge_group:
types: [checks_requested]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
micromamba-static-unix:
name: "${{ matrix.platform }}-${{ matrix.arch }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- {os: ubuntu-latest, platform: linux, arch: "64"}
- {os: ubuntu-latest, platform: linux, arch: aarch64}
- {os: ubuntu-latest, platform: linux, arch: ppc64le}
- {os: macos-latest, platform: osx, arch: "64"}
- {os: macos-latest, platform: osx, arch: arm64}
steps:
- name: Checkout micromamba-feedstock
uses: actions/checkout@v4
with:
repository: conda-forge/micromamba-feedstock
path: micromamba-feedstock
- name: Disable output validation
if: ${{ matrix.platform == 'osx' }}
run: |
cd micromamba-feedstock/
sed -i '' '/conda_forge_output_validation/d' conda-forge.yml
- name: Checkout mamba branch
uses: actions/checkout@v4
with:
path: mamba
- name: Clear mamba git directory and link source
# `source` subfolder is the special location looked-up by our feedstock.
# Due to Docker, we can only put it as a subfolder of `micromamba-feedstock`,
run: |
rm -rf "mamba/.git"
mv mamba/ micromamba-feedstock/source
# Prevent irrelevant file permission error
git -C micromamba-feedstock/ config --local --add safe.directory '*'
- uses: mamba-org/setup-micromamba@v2
with:
environment-name: mambabuild
create-args: python boa
post-cleanup: none # FIXME the cleanup fails on OSX
- name: Build conda package (Unix native)
if: ${{ !(matrix.platform == 'linux' && matrix.arch != '64') }}
shell: bash -l {0}
run: |
cd micromamba-feedstock/
# Special values for running the feedstock with a local source
export FEEDSTOCK_ROOT="${PWD}"
export CI="local"
# For OSX not using Docker
export CONDA_BLD_PATH="${PWD}/build_artifacts"
mkdir -p "${CONDA_BLD_PATH}"
python build-locally.py "${{ matrix.platform }}_${{ matrix.arch }}_"
# The build_locally.py script will test all Linux builds, which fails outside of linux-64
- name: Build conda package (Linux emulated)
if: ${{ matrix.platform == 'linux' && matrix.arch != '64' }}
uses: uraimo/run-on-arch-action@v2
with:
arch: ${{ matrix.arch }}
distro: ubuntu_latest
dockerRunArgs: -v /var/run/docker.sock:/var/run/docker.sock
install: |
apt-get update -y
apt-get install -y python3 docker.io
run: |
cd micromamba-feedstock/
# Prevent irrelevant file permission error
chown -R $(whoami) .
# Special values for running the feedstock with a local source
export FEEDSTOCK_ROOT="${PWD}"
export CI="local"
python3 build-locally.py "${{ matrix.platform }}_${{ matrix.arch }}_"
- name: Unpack micromamba package
shell: bash -l {0}
run: |
ls micromamba-feedstock/build_artifacts
micromamba package extract \
"micromamba-feedstock/build_artifacts/${{ matrix.platform }}-${{ matrix.arch }}/"micromamba-*.tar.bz2 "pkg/"
mkdir -p "${{ github.workspace }}/artifacts"
cp pkg/bin/micromamba "${{ github.workspace }}/artifacts"
- name: Test basic commands
if: ${{ matrix.arch != 'aarch64' && matrix.arch != 'ppc64le' }}
run: |
mkdir test_prefix
${{ github.workspace }}/artifacts/micromamba --version
${{ github.workspace }}/artifacts/micromamba --help
${{ github.workspace }}/artifacts/micromamba env create -y -n testenv -r ./test_prefix "python<3.13"
${{ github.workspace }}/artifacts/micromamba list -n testenv -r ./test_prefix --log-level 1
- name: Archive conda-build artifact
if: failure()
run: tar -czf ${{ github.workspace }}/micromamba-conda-build-failed-${{ matrix.platform }}-${{ matrix.arch }}.tar.gz $MAMBA_ROOT_PREFIX/envs/mambabuild/conda-bld/micromamba_*
- name: Upload conda build artifacts
uses: actions/upload-artifact@v4
if: failure()
with:
name: micromamba-conda-build-failed-${{ matrix.platform }}-${{ matrix.arch }}
path: ${{ github.workspace }}/micromamba-conda-build-failed-${{ matrix.platform }}-${{ matrix.arch }}.tar.gz
retention-days: 7
- name: Upload micromamba
uses: actions/upload-artifact@v4
with:
name: micromamba-${{ matrix.platform }}-${{ matrix.arch }}
path: ${{ github.workspace }}/artifacts/micromamba
micromamba-static-win:
name: "win-64"
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- name: Cache vcpkg packages
uses: actions/cache@v4
with:
# The installed packages are in %VCPKG_INSTALLATION_ROOT%\installed\x64-windows-static
# and the info which packages are installed is in %VCPKG_INSTALLATION_ROOT%\installed\vcpkg
path: C:\Users\runneradmin\AppData\Local\vcpkg
key: vcpkg-win-64-appdata
- name: Install dependencies with vcpkg
shell: cmd
# remove libsolv overlay-ports once https://github.com/microsoft/vcpkg/pull/31275 is released
run: |
vcpkg install --triplet x64-windows-static-md
- uses: hendrikmuhs/ccache-action@main
with:
variant: sccache
key: sccache-${{ github.job }}-win-64
- name: Set up MSVC
uses: ilammy/msvc-dev-cmd@v1
- uses: mamba-org/setup-micromamba@v2
with:
environment-name: mambabuild
init-shell: bash cmd.exe
# Constraint on fmt is due to an issue with 11.0.2 (to be fixed in next version)
# cf. https://github.com/fmtlib/fmt/issues/4091
create-args: >-
cli11>=2.2,<3
cpp-expected
nlohmann_json
simdjson-static>=3.3.0
spdlog
fmt<=11.0.1
yaml-cpp-static>=0.8.0
libsolv-static>=0.7.24
reproc-cpp-static>=14.2.4.post0
- name: build micromamba
shell: cmd /C call {0}
run: |
set CMAKE_PREFIX_PATH=.\vcpkg_installed\x64-windows-static-md;%CONDA_PREFIX%\Library
cmake -B build/ -G Ninja ^
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache ^
-D CMAKE_C_COMPILER_LAUNCHER=sccache ^
-D CMAKE_MSVC_RUNTIME_LIBRARY="MultiThreadedDLL" ^
-D CMAKE_BUILD_TYPE="Release" ^
-D BUILD_LIBMAMBA=ON ^
-D BUILD_STATIC=ON ^
-D BUILD_MICROMAMBA=ON
if %errorlevel% neq 0 exit /b %errorlevel%
cmake --build build/ --parallel
if %errorlevel% neq 0 exit /b %errorlevel%
sccache --show-stats
if %errorlevel% neq 0 exit /b %errorlevel%
.\build\micromamba\micromamba.exe --version
if %errorlevel% neq 0 exit /b %errorlevel%
.\build\micromamba\micromamba.exe --help
if %errorlevel% neq 0 exit /b %errorlevel%
- name: build cache statistics
run: sccache --show-stats
- name: Archive-build artifact
if: failure()
run: tar -czf ${{ github.workspace }}/micromamba-build-failed-win-64.tar.gz ${{ github.workspace }}/build/
- name: Test basic commands
run: |
mkdir test_prefix
${{ github.workspace }}/build/micromamba/micromamba.exe --version
${{ github.workspace }}/build/micromamba/micromamba.exe --help
${{ github.workspace }}/build/micromamba/micromamba.exe env create -y -n testenv -r ./test_prefix "python<3.13"
${{ github.workspace }}/build/micromamba/micromamba.exe list -n testenv -r ./test_prefix --log-level 1
- name: Upload build artifacts
uses: actions/upload-artifact@v4
if: failure()
with:
name: micromamba-build-failed-win-64
path: ${{ github.workspace }}/micromamba-build-failed-win-64.tar.gz
retention-days: 7
- uses: actions/upload-artifact@v4
with:
name: micromamba-win-64
path: ${{ github.workspace }}/build/micromamba/micromamba.exe