-
Notifications
You must be signed in to change notification settings - Fork 3
268 lines (224 loc) · 7.96 KB
/
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
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
name: CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:
permissions:
contents: read
actions: read
checks: write
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
linux-ci:
strategy:
matrix:
include:
- py-version: '3.10'
c-compiler: 'gcc'
cxx-compiler: 'g++'
- py-version: '3.11'
c-compiler: 'gcc'
cxx-compiler: 'g++'
- py-version: '3.12'
c-compiler: 'gcc'
cxx-compiler: 'g++'
- py-version: '3.10'
c-compiler: 'clang'
cxx-compiler: 'clang++'
fail-fast: false
name: Linux ${{ matrix.c-compiler}} Python ${{ matrix.py-version }}
runs-on: ubuntu-latest
timeout-minutes: 180
env:
MPIEXEC_FLAGS: "--allow-run-as-root --oversubscribe"
PYNUCLEUS_BUILD_PARALLELISM: 2
OMPI_CC: ${{ matrix.c-compiler }}
OMPI_CXX: ${{ matrix.cxx-compiler }}
BUILD_PRETTY_IDENTIFIER: "Linux ${{ matrix.c-compiler }} Python ${{ matrix.py-version }}"
BUILD_IDENTIFIER: "Linux-${{ matrix.c-compiler }}-${{ matrix.py-version }}"
OMP_NUM_THREADS: 1
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- name: Check out repo
if: always()
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Pull ccache cache
if: always()
id: ccache-restore
uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: /home/runner/.cache/ccache
key: ccache-${{ env.BUILD_IDENTIFIER }}
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
if: always()
with:
python-version: ${{ matrix.py-version }}
- name: Install Ubuntu packages
if: always()
run: |
sudo apt-get update
sudo apt-get install -yq mpi-default-bin mpi-default-dev libmetis-dev libparmetis-dev libsuitesparse-dev ccache
- name: Get ccache config dir
if: always()
run: ccache --show-config
- name: Install Python dependencies
if: always()
run: make prereq && make prereq-extra
- name: Install
if: always()
run: python -m pip list && make install PIP_INSTALL_FLAGS="--no-use-pep517 -vvv"
- name: Remove ccache cache
if: ${{ steps.ccache-restore.outputs.cache-hit }}
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
gh extension install actions/gh-actions-cache
gh actions-cache delete ccache-${{ env.BUILD_IDENTIFIER }} --confirm
continue-on-error: true
- name: Push ccache cache
if: always()
uses: actions/cache/save@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: /home/runner/.cache/ccache
key: ccache-${{ env.BUILD_IDENTIFIER }}
- name: Ccache report
if: always()
run: ccache -s
- name: Run tests
if: always()
run: python3 -m pytest --junit-xml=test-results-${{ env.BUILD_IDENTIFIER }}.xml tests/
- name: Run flake8
if: always()
run: |
make flake8
mv flake8.xml flake8-${{ env.BUILD_IDENTIFIER }}.xml
- name: Run cython-lint
if: always()
run: |
make cython-lint
mv cython-lint.xml cython-lint-${{ env.BUILD_IDENTIFIER }}.xml
- name: Archive results
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
if: always()
with:
name: Results (${{ env.BUILD_PRETTY_IDENTIFIER }})
path: |
test-results-${{ env.BUILD_IDENTIFIER }}.xml
flake8-${{ env.BUILD_IDENTIFIER }}.xml
cython-lint-${{ env.BUILD_IDENTIFIER }}.xml
- name: Report results
uses: dorny/test-reporter@1a288b62f8b75c0f433cbfdbc2e4800fbae50bd7 # v1
if: always()
with:
name: Report (${{ env.BUILD_PRETTY_IDENTIFIER }})
path: |
*-${{ env.BUILD_IDENTIFIER }}.xml
reporter: java-junit
fail-on-error: false
mac-ci:
strategy:
matrix:
py-version: ['3.10']
fail-fast: false
name: Mac clang Python ${{ matrix.py-version }}
runs-on: macos-12
timeout-minutes: 180
env:
MPIEXEC_FLAGS: "--allow-run-as-root --oversubscribe"
PYNUCLEUS_BUILD_PARALLELISM: 3
SUITESPARSE_INCLUDE_DIR: /usr/local/Cellar/brewsci-suite-sparse/4.5.5_2/include
SUITESPARSE_LIBRARY_DIR: /usr/local/Cellar/brewsci-suite-sparse/4.5.5_2/lib
LDFLAGS: -L/usr/local/opt/brewsci-metis/lib -L/usr/local/opt/brewsci-parmetis/lib
CPPFLAGS: -I/usr/local/opt/brewsci-metis/include -I/usr/local/opt/brewsci-parmetis/include
OMP_NUM_THREADS: 1
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- name: Check out repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Pull ccache cache
if: always()
id: ccache-restore
uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: /Users/runner/Library/Caches/ccache
key: ccache-${{ runner.os }}-${{ matrix.py-version }}
- name: Setup GNU Fortran
uses: fortran-lang/setup-fortran@8821f57b53846d35d62632eb51c60ac6c4bff4ce # v1.6.1
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: ${{ matrix.py-version }}
- name: Install packages
run: |
brew install open-mpi ccache
brew tap brewsci/num
brew install brewsci-metis brewsci-parmetis brewsci-suite-sparse
- name: Get ccache config dir
if: always()
run: ccache --show-config
- name: Augment path
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install Python dependencies
run: make prereq && make prereq-extra
- name: Install
run: PIP_INSTALL_FLAGS=-vvv make install
- name: Remove ccache cache
if: ${{ steps.ccache-restore.outputs.cache-hit }}
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
gh extension install actions/gh-actions-cache
gh actions-cache delete ccache-${{ runner.os }}-${{ matrix.py-version }} --confirm
continue-on-error: true
- name: Push ccache cache
if: always()
uses: actions/cache/save@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: /Users/runner/Library/Caches/ccache
key: ccache-${{ runner.os }}-${{ matrix.py-version }}
- name: Ccache report
if: always()
run: ccache -s
- name: Run tests
if: always()
run: python3 -m pytest --junit-xml=test-results-${{ runner.os }}-${{ matrix.py-version }}.xml tests/
- name: Run flake8
if: always()
run: |
make flake8
mv flake8.xml flake8-${{ runner.os }}-${{ matrix.py-version }}.xml
- name: Run cython-lint
if: always()
run: |
make cython-lint
mv cython-lint.xml cython-lint-${{ runner.os }}-${{ matrix.py-version }}.xml
- name: Archive results
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
if: always()
with:
name: Results ${{ github.job }}
path: |
test-results-${{ runner.os }}-${{ matrix.py-version }}.xml
flake8-${{ runner.os }}-${{ matrix.py-version }}.xml
cython-lint-${{ runner.os }}-${{ matrix.py-version }}.xml
- name: Report results
uses: dorny/test-reporter@1a288b62f8b75c0f433cbfdbc2e4800fbae50bd7 # v1
if: always()
with:
name: Report (${{ github.job }})
path: |
*-${{ runner.os }}-${{ matrix.py-version }}.xml
reporter: java-junit
fail-on-error: false