-
Notifications
You must be signed in to change notification settings - Fork 68
300 lines (264 loc) · 10.8 KB
/
macos_build_test.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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
name: MacOS Build/Test Cyclus
on:
# allows us to run workflows manually
workflow_dispatch:
pull_request:
paths-ignore:
- '.github/workflows/build_test.yml'
- '.github/workflows/publish_latest.yml'
- '.github/workflows/publish_release.yml'
- '.github/workflows/changelog_test.yml'
- '.github/workflows/code_coverage.yml'
- '.github/workflows/rocky_build_test.yml'
- 'doc/**'
- 'CHANGELOG.rst'
push:
paths-ignore:
- '.github/workflows/build_test.yml'
- '.github/workflows/publish_latest.yml'
- '.github/workflows/publish_release.yml'
- '.github/workflows/changelog_test.yml'
- '.github/workflows/code_coverage.yml'
- '.github/workflows/rocky_build_test.yml'
- 'doc/**'
- 'CHANGELOG.rst'
jobs:
build-test-brew:
strategy:
fail-fast: false
matrix:
macos_versions : [
macos-12,
macos-13,
macos-14,
]
runs-on: [ "${{ matrix.macos_versions }}" ]
steps:
- name: Checkout Cyclus
uses: actions/checkout@v4
- name: --slow flag if on ARM
if: ${{ matrix.macos_versions == 'macos-14' }}
run: |
echo "SLOW_FLAG=--slow" >> "$GITHUB_ENV"
- name: Build and Test Cyclus
id: build-cyclus
run: |
brew install \
boost \
libxml++@4 \
hdf5 \
cbc \
clp \
python3
export PATH=$(brew --prefix python3)/bin:$PATH
python3 -m pip install --target $(python -m site --user-site) \
cython \
jinja2 \
numpy \
pandas \
setuptools \
pytest \
tables
python3 install.py -j 3 --coin-root $(brew --prefix) --allow-milps ${SLOW_FLAG}
export PATH=$HOME/.local/bin:$PATH
export DYLD_LIBRARY_PATH=$HOME/.local/lib
cyclus_unit_tests
cd tests && python3 -m pytest
- name: Checkout Cycamore
if: ${{ github.event_name == 'pull_request' && steps.build-cyclus.outcome == 'success' }}
uses: actions/checkout@v4
with:
repository: bennibbelink/cycamore
path: ${{ github.workspace }}/cycamore
ref: macos
- name: Build and Test Cycamore
id: build-cycamore
if: ${{ github.event_name == 'pull_request' && steps.build-cyclus.outcome == 'success' }}
continue-on-error: true
run: |
cd ${{ github.workspace }}/cycamore
python3 install.py -j 3 --allow-milps
export PATH=$HOME/.local/bin:$PATH
export DYLD_LIBRARY_PATH=$HOME/.local/lib
cycamore_unit_tests
cd tests && python3 -m pytest
- name: Checkout Cymetric
if: ${{ github.event_name == 'pull_request' && steps.build-cycamore.outcome == 'success' }}
uses: actions/checkout@v4
with:
repository: cyclus/cymetric
path: ${{ github.workspace }}/cymetric
- name: Build and Test Cymetric
id: build-cymetric
if: ${{ github.event_name == 'pull_request' && steps.build-cycamore.outcome == 'success' }}
continue-on-error: true
run: |
cd ${{ github.workspace }}/cymetric
python3 -m pip install --target $(python3 -m site --user-site) .
export PATH=$HOME/.local/bin:$PATH
export DYLD_LIBRARY_PATH=$HOME/.local/lib
cd tests && python3 -m pytest
- name: Export Environment Variables
if: github.event_name == 'pull_request'
run: |
echo "CYCAMORE_BUILD_STATUS=${{steps.build-cycamore.outcome == 'success' && '**Success** :white_check_mark:' ||
steps.build-cycamore.outcome == 'failure' && '**Failure** :x:' ||
'**Skipped due to upstream failure** :warning:'}}" >> "$GITHUB_ENV"
echo "CYMETRIC_BUILD_STATUS=${{steps.build-cymetric.outcome == 'success' && '**Success** :white_check_mark:' ||
steps.build-cymetric.outcome == 'failure' && '**Failure** :x:' ||
'**Skipped due to upstream failure** :warning:'}}" >> "$GITHUB_ENV"
echo "ARTIFACT_NAME=${{ matrix.macos_versions }}" >> "$GITHUB_ENV"
- name: Construct Artifact
if: github.event_name == 'pull_request'
run: |
echo "
##### Build \`${{ matrix.macos_versions }}\`
- Cycamore: ${{ env.CYCAMORE_BUILD_STATUS }}
- Cymetric: ${{ env.CYMETRIC_BUILD_STATUS }}" > ${{ env.ARTIFACT_NAME }}.txt
- name: Upload Artifact
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.ARTIFACT_NAME }}.txt
build-test-conda:
strategy:
fail-fast: false
matrix:
macos_versions : [
macos-12,
macos-13,
macos-14,
]
runs-on: [ "${{ matrix.macos_versions }}" ]
steps:
- name: Checkout Cyclus
uses: actions/checkout@v4
- name: --slow flag if on ARM
if: ${{ matrix.macos_versions == 'macos-14' }}
run: |
echo "SLOW_FLAG=--slow" >> "$GITHUB_ENV"
echo "ARM=arm" >> "$GITHUB_ENV"
- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: "latest"
miniforge-variant: "Mambaforge"
conda-solver: "libmamba"
auto-update-conda: true
auto-activate-base: true
activate-environment: ""
channels: conda-forge
- name: Build and Test Cyclus
id: build-cyclus
run: |
conda install -y \
clang_osx-${ARM}64 \
clangxx_osx-${ARM}64 \
cmake \
make \
git \
glib \
libxml2 \
libxmlpp-4.0 \
liblapack \
pkg-config \
coincbc \
libboost-devel \
hdf5 \
sqlite \
pcre \
setuptools \
pytest \
pytables \
pandas \
jinja2 \
cython \
websockets \
pprintpp \
pip
export CC=$(conda info --base)/bin/clang
export CXX=$(conda info --base)/bin/clang++
export CPP=$(conda info --base)/bin/clang-cpp
python3 install.py -j 3 --allow-milps ${SLOW_FLAG} --cmake-prefix-path ${CONDA_PREFIX}
export PATH=$HOME/.local/bin:$PATH
export DYLD_LIBRARY_PATH=$HOME/.local/lib
cyclus_unit_tests
cd tests && python3 -m pytest
- name: Checkout Cycamore
if: ${{ github.event_name == 'pull_request' && steps.build-cyclus.outcome == 'success' }}
uses: actions/checkout@v4
with:
repository: bennibbelink/cycamore
path: ${{ github.workspace }}/cycamore
ref: macos
- name: Build and Test Cycamore
id: build-cycamore
if: ${{ github.event_name == 'pull_request' && steps.build-cyclus.outcome == 'success' }}
continue-on-error: true
run: |
cd ${{ github.workspace }}/cycamore
python3 install.py -j 3 --allow-milps
export PATH=$HOME/.local/bin:$PATH
export DYLD_LIBRARY_PATH=$HOME/.local/lib
cycamore_unit_tests
cd tests && python3 -m pytest
- name: Checkout Cymetric
if: ${{ github.event_name == 'pull_request' && steps.build-cycamore.outcome == 'success' }}
uses: actions/checkout@v4
with:
repository: cyclus/cymetric
path: ${{ github.workspace }}/cymetric
- name: Build and Test Cymetric
id: build-cymetric
if: ${{ github.event_name == 'pull_request' && steps.build-cycamore.outcome == 'success' }}
continue-on-error: true
run: |
cd ${{ github.workspace }}/cymetric
python3 -m pip install --target $(python3 -m site --user-site) .
export PATH=$HOME/.local/bin:$PATH
export DYLD_LIBRARY_PATH=$HOME/.local/lib
cd tests && python3 -m pytest
- name: Export Environment Variables
if: github.event_name == 'pull_request'
run: |
echo "CYCAMORE_BUILD_STATUS=${{steps.build-cycamore.outcome == 'success' && '**Success** :white_check_mark:' ||
steps.build-cycamore.outcome == 'failure' && '**Failure** :x:' ||
'**Skipped due to upstream failure** :warning:'}}" >> "$GITHUB_ENV"
echo "CYMETRIC_BUILD_STATUS=${{steps.build-cymetric.outcome == 'success' && '**Success** :white_check_mark:' ||
steps.build-cymetric.outcome == 'failure' && '**Failure** :x:' ||
'**Skipped due to upstream failure** :warning:'}}" >> "$GITHUB_ENV"
echo "ARTIFACT_NAME=${{ matrix.macos_versions }}" >> "$GITHUB_ENV"
- name: Construct Artifact
if: github.event_name == 'pull_request'
run: |
echo "
##### Build \`${{ matrix.macos_versions }}\`
- Cycamore: ${{ env.CYCAMORE_BUILD_STATUS }}
- Cymetric: ${{ env.CYMETRIC_BUILD_STATUS }}" > ${{ env.ARTIFACT_NAME }}.txt
- name: Upload Artifact
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.ARTIFACT_NAME }}.txt
upload-pr-number:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Checkout cyclus
uses: actions/checkout@v4
- name: Save PR number and Commit hash to file
run: |
echo "${{ github.event.number }}" > pr_number
echo "${{ github.event.pull_request.head.sha }} - $(git log -1 --format=%ci)" > commit_hash_timestamp
- name: Upload PR number artifact
uses: actions/upload-artifact@v4
with:
name: pr_number
path: pr_number
- name: Upload Commit hash artifact
uses: actions/upload-artifact@v4
with:
name: commit_hash_timestamp
path: commit_hash_timestamp