forked from MODFLOW-USGS/modflow6
-
Notifications
You must be signed in to change notification settings - Fork 0
294 lines (260 loc) · 10.7 KB
/
compilers.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
name: MODFLOW 6 compiler checks
on:
# workflow_dispatch trigger to start release via GitHub UI or CLI, see
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
workflow_dispatch:
env:
PIXI_BETA_WARNING_OFF: true
jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# combinations from https://github.com/fortran-lang/setup-fortran#runner-compatibility
include:
# gfortran
- {os: ubuntu-22.04, compiler: gcc, version: 11}
- {os: ubuntu-22.04, compiler: gcc, version: 12}
- {os: ubuntu-22.04, compiler: gcc, version: 13}
- {os: macos-13, compiler: gcc, version: 11}
- {os: macos-13, compiler: gcc, version: 12}
- {os: macos-13, compiler: gcc, version: 13}
- {os: macos-14, compiler: gcc, version: 11}
- {os: macos-14, compiler: gcc, version: 12}
- {os: macos-14, compiler: gcc, version: 13}
- {os: windows-2022, compiler: gcc, version: 11}
- {os: windows-2022, compiler: gcc, version: 12}
- {os: windows-2022, compiler: gcc, version: 13}
# ifx
- {os: ubuntu-22.04, compiler: intel, version: 2024.1}
- {os: ubuntu-22.04, compiler: intel, version: "2024.0"}
- {os: ubuntu-22.04, compiler: intel, version: 2023.2}
- {os: ubuntu-22.04, compiler: intel, version: 2023.1}
- {os: ubuntu-22.04, compiler: intel, version: "2023.0"}
- {os: ubuntu-22.04, compiler: intel, version: 2022.2.1}
- {os: ubuntu-22.04, compiler: intel, version: 2022.2}
- {os: windows-2022, compiler: intel, version: 2024.1}
- {os: windows-2022, compiler: intel, version: "2024.0"}
- {os: windows-2022, compiler: intel, version: 2023.2}
- {os: windows-2022, compiler: intel, version: 2023.1}
- {os: windows-2022, compiler: intel, version: "2023.0"}
- {os: windows-2022, compiler: intel, version: 2022.2}
# ifort
- {os: ubuntu-22.04, compiler: intel-classic, version: "2021.10"}
- {os: ubuntu-22.04, compiler: intel-classic, version: 2021.9}
- {os: ubuntu-22.04, compiler: intel-classic, version: 2021.8}
- {os: ubuntu-22.04, compiler: intel-classic, version: 2021.7}
- {os: ubuntu-22.04, compiler: intel-classic, version: 2021.6}
- {os: ubuntu-22.04, compiler: intel-classic, version: 2021.5}
- {os: ubuntu-22.04, compiler: intel-classic, version: 2021.4}
- {os: ubuntu-22.04, compiler: intel-classic, version: 2021.3}
- {os: ubuntu-22.04, compiler: intel-classic, version: 2021.2}
- {os: ubuntu-22.04, compiler: intel-classic, version: 2021.1}
- {os: macos-13, compiler: intel-classic, version: "2021.10"}
- {os: macos-13, compiler: intel-classic, version: 2021.9}
- {os: macos-13, compiler: intel-classic, version: 2021.8}
- {os: macos-13, compiler: intel-classic, version: 2021.7}
- {os: macos-13, compiler: intel-classic, version: 2021.6}
- {os: macos-13, compiler: intel-classic, version: 2021.5}
- {os: macos-13, compiler: intel-classic, version: 2021.4}
- {os: macos-13, compiler: intel-classic, version: 2021.3}
- {os: macos-13, compiler: intel-classic, version: 2021.2}
- {os: macos-13, compiler: intel-classic, version: 2021.1}
- {os: windows-2022, compiler: intel-classic, version: "2021.10"}
- {os: windows-2022, compiler: intel-classic, version: 2021.9}
- {os: windows-2022, compiler: intel-classic, version: 2021.8}
- {os: windows-2022, compiler: intel-classic, version: 2021.7}
- {os: windows-2022, compiler: intel-classic, version: 2021.6}
defaults:
run:
shell: bash
steps:
- name: Checkout modflow6
uses: actions/checkout@v4
with:
path: modflow6
- name: Checkout modflow6-testmodels
uses: actions/checkout@v4
with:
repository: MODFLOW-USGS/modflow6-testmodels
path: modflow6-testmodels
- name: Checkout modflow6-examples
uses: actions/checkout@v4
with:
repository: MODFLOW-USGS/modflow6-examples
path: modflow6-examples
- name: Setup ${{ matrix.compiler }} ${{ matrix.version }}
uses: fortran-lang/setup-fortran@v1
with:
compiler: ${{ matrix.compiler}}
version: ${{ matrix.version }}
- name: Setup pixi
uses: prefix-dev/setup-pixi@v0.8.1
with:
pixi-version: v0.24.2
manifest-path: "modflow6/pixi.toml"
- name: Custom pixi install
working-directory: modflow6
run: pixi run install
- name: Build modflow6
working-directory: modflow6
run: |
pixi run setup builddir
pixi run build builddir
- name: Show build log
if: failure()
working-directory: modflow6
run: cat builddir/meson-logs/meson-log.txt
- name: Upload build log
if: failure()
uses: actions/upload-artifact@v3
with:
name: meson-log.txt
path: modflow6/builddir/meson-logs/meson-log.txt
- name: Unit test programs
if: success()
working-directory: modflow6
run: pixi run test builddir
- name: Create compile report
if: success() || failure()
shell: bash
run: |
if [[ "${{ job.status }}" == "success" ]]; then
support="✓"
else
support=""
fi
mkdir -p compat
prefix="${{ matrix.os }},${{ matrix.compiler }},${{ matrix.version }}"
echo "$prefix,$support" >> "compat/comp_${prefix//,/_}.csv"
- name: Update flopy
if: success()
working-directory: modflow6/autotest
run: pixi run update-flopy
- name: Get executables
if: success()
working-directory: modflow6/autotest
env:
GITHUB_TOKEN: ${{ github.token }}
run: pixi run get-exes
- name: Test modflow6
if: success()
working-directory: modflow6
env:
REPOS_PATH: ${{ github.workspace }}
run: pixi run autotest
- name: Create test report
if: success() || failure()
shell: bash
run: |
if [[ "${{ job.status }}" == "success" ]]; then
support="✓"
else
support=""
fi
mkdir -p compat
prefix="${{ matrix.os }},${{ matrix.compiler }},${{ matrix.version }}"
echo "$prefix,$support" >> "compat/test_${prefix//,/_}.csv"
- name: Upload reports
if: success() || failure()
uses: actions/upload-artifact@v3
with:
name: compat
path: compat/*.csv
report:
name: Make compatibility report
if: success() || failure()
needs: test
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install packages
run: pip install tabulate pandas
- name: Download reports
uses: actions/download-artifact@v3
with:
name: compat
path: .github/compat/new
- name: Concatenate reports
working-directory: .github/compat
run: |
cols="runner,compiler,version,support"
echo "$cols" > long_comp.csv
echo "$cols" > long_test.csv
cat new/comp*.csv >> long_comp.csv
cat new/test*.csv >> long_test.csv
- name: Make wide CSV and MD tables
working-directory: .github/compat
id: merge-reports
run: |
python ../common/widen_compat_reports.py "long_comp.csv" "comp.csv"
python ../common/widen_compat_reports.py "long_test.csv" "test.csv"
# only upload wide CSVs and Markdown tables
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: compat
path: |
.github/compat/comp.*
.github/compat/test.*
# update DEVELOPER.md if this is not a push event and there are any changes
- name: Check for changes
working-directory: .github/compat
if: github.event_name != 'pull_request'
id: diff
run: |
if ! [ -f comp.csv ]; then
echo "diff=false" >> $GITHUB_OUTPUT
exit 0
fi
diff_comp=$(git diff comp.csv)
diff_test=$(git diff test.csv)
if [[ ( $diff_comp == "" ) && ( $diff_test == "" ) ]]; then
echo "No changes found"
echo "diff=false" >> $GITHUB_OUTPUT
else
echo "comp.csv diff:"
echo "$diff_comp"
echo "test.csv diff:"
echo "$diff_test"
echo "diff=true" >> $GITHUB_OUTPUT
fi
- name: Update DEVELOPER.md
if: ${{ steps.diff.outputs.diff == 'true' && github.event_name != 'pull_request' }}
run: |
python .github/common/update_compat_tables.py "compile" ".github/compat/comp.md" "DEVELOPER.md"
python .github/common/update_compat_tables.py "test" ".github/compat/test.md" "DEVELOPER.md"
- name: Print DEVELOPER.md diff
if: ${{ steps.diff.outputs.diff == 'true' && github.event_name != 'pull_request' }}
run: git diff DEVELOPER.md
- name: Create pull request
if: ${{ steps.diff.outputs.diff == 'true' && github.event_name != 'pull_request' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# one at a time
head="compat"
id=$(gh pr list -H $head -s open --json id -q ".[0].id")
[[ -n "${id// /}" ]] && (echo "PR already open"; exit 0) || (echo "opening PR")
# setup bot user
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
# create new branch
git switch -c "$head"
# commit and push
git add DEVELOPER.md .github/compat/comp.csv .github/compat/test.csv
git commit -m "Update compatibility tables"
git push -u origin "$head"
# open PR
cat <(echo '### Compile') <(echo) .github/compat/comp.md <(echo) <(echo '### Test') <(echo) .github/compat/test.md > compat.md
gh pr create -B "${{ github.event.repository.default_branch }}" -H "$head" --title "Update compile/test compatibility tables" --body-file compat.md