-
Notifications
You must be signed in to change notification settings - Fork 0
262 lines (227 loc) · 10.7 KB
/
cd.yml
File metadata and controls
262 lines (227 loc) · 10.7 KB
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
260
261
name: CD
on: [push, workflow_dispatch]
jobs:
native-build:
name:
native-build-${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform: [windows-latest, ubuntu-latest, ubuntu-24.04-arm, macos-13, macos-latest]
#platform: [windows-latest, windows-11-arm, ubuntu-latest, ubuntu-24.04-arm, macos-13, macos-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: checkout vcell-ode repo
uses: actions/checkout@v4
- name: Install Windows Dependencies (Part 0 - Setup LLVM-style)
if: matrix.platform == 'windows-latest' || matrix.platform == 'windows-11-arm'
uses: llvm/actions/setup-windows@main
with:
arch: amd64
- name: Install Windows Dependencies (Part 1 - Configure Conan ...and zip)
if: matrix.platform == 'windows-latest' || matrix.platform == 'windows-11-arm'
shell: powershell
run: |
choco install zip -y
choco install conan -y
$conanDir = "C:\Program Files\Conan\conan"
$env:PATH = "$conanDir;$env:PATH"
$conanDir | Set-Content -Path $env:GITHUB_PATH
$env:CONAN_HOME = "C:\.conan"
"CONAN_HOME=C:\.conan" | Out-File -FilePath $env:GITHUB_ENV -Append
conan --version
conan profile detect --force
- name: Install Windows Dependencies (Part 2 - Reconfigure Conan) <x86_64>
if: matrix.platform == 'windows-latest'
shell: bash
run: |
cp conan-profiles/CI-CD/Windows-AMD64_profile.txt $CONAN_HOME/profiles/default
- name: Install Windows Dependencies (Part 2 - Reconfigure Conan) <ARM>
if: matrix.platform == 'windows-11-arm'
shell: bash
run: |
cp conan-profiles/CI-CD/Windows-ARM64_profile.txt $CONAN_HOME/profiles/default
- name: Install MacOS dependencies <x86_64>
if: matrix.platform == 'macos-13'
shell: bash
run: |
brew install conan
conan --version
mkdir -p ~/.conan2/profiles/
touch ~/.conan2/profiles/default # if we don't make a file first, cp thinks its a folder that doesn't exist
cp conan-profiles/CI-CD/MacOS-AMD64_profile.txt ~/.conan2/profiles/default
- name: Install MacOS dependencies <ARM>
if: matrix.platform == 'macos-latest'
shell: bash
run: |
brew install conan
conan --version
mkdir -p ~/.conan2/profiles/
touch ~/.conan2/profiles/default # if we don't make a file first, cp thinks its a folder that doesn't exist
cp conan-profiles/CI-CD/MacOS-ARM64_profile.txt ~/.conan2/profiles/default
- name: Install Linux Dependencies <x86_64>
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt update
sudo apt upgrade -y
sudo apt install -y wget
wget --version
wget https://github.com/conan-io/conan/releases/download/2.17.0/conan-2.17.0-amd64.deb
sudo apt install -y ./conan-*.deb
conan --version
mkdir -p ~/.conan2/profiles/
touch ~/.conan2/profiles/default # if we don't make a file first, cp thinks its a folder that doesn't exist
cp conan-profiles/CI-CD/Linux-AMD64_profile.txt ~/.conan2/profiles/default
- name: Install Linux Dependencies <ARM>
if: matrix.platform == 'ubuntu-24.04-arm'
run: |
sudo apt update
python3 -m pip install conan
conan --version
mkdir -p ~/.conan2/profiles/
touch ~/.conan2/profiles/default # if we don't make a file first, cp thinks its a folder that doesn't exist
cp conan-profiles/CI-CD/Linux-ARM64_profile.txt ~/.conan2/profiles/default
- name: Install Dependencies through Conan on Windows
if: matrix.platform == 'windows-latest' || matrix.platform == 'windows-11-arm'
shell: powershell
run: |
conan install . --output-folder build --build=missing -o include_messaging=False
- name: Install Dependencies through Conan on MacOS
if: matrix.platform == 'macos-13' || matrix.platform == 'macos-latest'
shell: bash
run: |
conan install . --output-folder build --build=missing
- name: Install Dependencies through Conan on Linux <x86_64>
if: matrix.platform == 'ubuntu-latest'
shell: bash
run: |
sudo apt --purge remove gcc
sudo ln -s /usr/bin/clang /usr/bin/cc
sudo apt install mold libc++-dev libc++abi-dev
sudo rm /usr/bin/ld
sudo ln -s $(which mold) /usr/bin/ld
conan install . --output-folder build --build=missing
- name: Install Dependencies through Conan on Linux <ARM>
if: matrix.platform == 'ubuntu-24.04-arm'
shell: bash
run: |
sudo apt --purge remove gcc
sudo ln -s /usr/bin/clang /usr/bin/cc
sudo ln -s /usr/bin/clang /usr/bin/gcc
sudo ln -s /usr/bin/clang++ /usr/bin/g++
sudo apt install mold libc++-dev libc++abi-dev
sudo rm /usr/bin/ld
sudo ln -s $(which mold) /usr/bin/ld
conan install . --output-folder build --build=missing
- name: Build Windows
if: matrix.platform == 'windows-latest' || matrix.platform == 'windows-11-arm'
shell: powershell
run: |
cd build
./conanbuild.ps1
cmake -B . -S .. -G "Ninja" -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release
- name: Build Unix
if: matrix.platform == 'ubuntu-latest' || matrix.platform == 'ubuntu-24.04-arm' || matrix.platform == 'macos-13' || matrix.platform == 'macos-latest'
run: |
echo "working dir is $PWD"
cd build
source conanbuild.sh
cmake -B . -S .. -G "Ninja" -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release
- name: Test Windows
if: matrix.platform == 'windows-latest' || matrix.platform == 'windows-11-arm'
run: |
cd build
ctest -VV
./bin/SundialsSolverStandalone_x64 || true
- name: Test Unix
if: matrix.platform == 'ubuntu-latest' || matrix.platform == 'ubuntu-24.04-arm' || matrix.platform == 'macos-13' || matrix.platform == 'macos-latest'
run: |
cd build
ctest -VV
echo "------ running SundialsSolverStandalone_x64 ------"
./bin/SundialsSolverStandalone_x64 || true
- name: fix Macos shared object paths
if: matrix.platform == 'macos-13' || matrix.platform == 'macos-latest'
shell: bash
run: |
mkdir build/upload
cd build/bin
rm hello_test TestVCellStoch testzip ziptool || true
ls *_x64 | awk '{print $1}' | xargs -I '{}' otool -L '{}' | grep ")" | grep -v "build" | grep -v "System" | awk '{print $1}' | xargs -I '{}' cp -vn '{}' . || true
ls *.dylib | awk '{print $1}' | xargs -I '{}' otool -L '{}' | grep ")" | grep -v "build" | grep -v "System" | awk '{print $1}' | xargs -I '{}' cp -vn '{}' . || true
ls *.dylib | awk '{print $1}' | xargs -I '{}' otool -L '{}' | grep ")" | grep -v "build" | grep -v "System" | awk '{print $1}' | xargs -I '{}' cp -vn '{}' . || true
chmod u+w,+x *
tar czvf ../upload/mac64_bad_paths.tgz .
../../.github/scripts/install_name_tool_macos.sh
tar czvf ../upload/mac64.tgz --dereference .
- name: handle shared object paths for Windows native build
if: matrix.platform == 'windows-latest' || matrix.platform == 'windows-11-arm'
shell: bash
run: |
mkdir build/upload
cd build/bin
rm hello_test* *.pdb || true
ls *.exe | awk '{print $1}' | xargs -I '{}' ldd '{}' | grep '=> /' | grep -v build | grep -iv windows | awk '{print $3}' | xargs -I '{}' cp -vn '{}' . || true
# Currently, Sundials only requires system32 dlls!
# ls *.dll | awk '{print $1}' | xargs -I '{}' ldd '{}' | grep '=> /' | grep -v build | grep -iv windows | awk '{print $3}' | xargs -I '{}' cp -vn '{}' . || true
# ls *.dll | awk '{print $1}' | xargs -I '{}' ldd '{}' | grep '=> /' | grep -v build | grep -iv windows | awk '{print $3}' | xargs -I '{}' cp -vn '{}' . || true
chmod u+w,+x *
zip ../upload/win64.zip ./*
cd ../..
# fi
- name: handle shared object paths for Linux native build
if: matrix.platform == 'ubuntu-latest' || matrix.platform == 'ubuntu-24.04-arm'
shell: bash
run: |
mkdir build/upload
cd build/bin
rm hello_test TestVCellStoch testzip ziptool || true
ls *_x64 | awk '{print $1}' | xargs -I '{}' ldd '{}' | grep "=> /" | grep -v "build" | awk '{print $3}' | xargs -I '{}' cp -vn '{}' . || true
ls *.so | awk '{print $1}' | xargs -I '{}' ldd '{}' | grep "=> /" | grep -v "build" | awk '{print $3}' | xargs -I '{}' cp -vn '{}' . || true
ls *.so | awk '{print $1}' | xargs -I '{}' ldd '{}' | grep "=> /" | grep -v "build" | awk '{print $3}' | xargs -I '{}' cp -vn '{}' . || true
chmod u+w,+x *
tar czvf ../upload/linux64.tgz --dereference .
cd ../..
- name: Upload Intel Macos binaries
if: matrix.platform == 'macos-13'
uses: actions/upload-artifact@v4
with:
name: macos_x86_64.tgz
path: build/upload/mac_x86_64.tgz
- name: Upload ARM Macos binaries
if: matrix.platform == 'macos-latest'
uses: actions/upload-artifact@v4
with:
name: macos_arm64.tgz
path: build/upload/mac_arm_64.tgz
- name: Upload Windows (x86_64) binaries
if: matrix.platform == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: win64.zip
path: build/upload/win_x86_64.zip
- name: Upload Windows (ARMv8) binaries
if: matrix.platform == 'windows-11-arm'
uses: actions/upload-artifact@v4
with:
name: win64.zip
path: build/upload/win_ARMv8_64.zip
- name: Upload Linux (x86_64) binaries
if: matrix.platform == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: linux64.tgz
path: build/upload/linux_x86_64.tgz
- name: Upload Linux (ARMv8) binaries
if: matrix.platform == 'ubuntu-24.04-arm'
uses: actions/upload-artifact@v4
with:
name: linux64.tgz
path: build/upload/linux_ARMv8_64.tgz
- name: Setup tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: false