-
Notifications
You must be signed in to change notification settings - Fork 56
193 lines (161 loc) · 5.6 KB
/
ex-workflow.yml
File metadata and controls
193 lines (161 loc) · 5.6 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
name: CI
env:
DISTNAME: mf6examples
on:
push:
paths-ignore:
- 'README.md'
- 'DEVELOPER.md'
pull_request:
branches:
- master
- develop
paths-ignore:
- 'README.md'
- 'DEVELOPER.md'
workflow_dispatch:
jobs:
lint:
name: Lint/format example scripts
runs-on: ubuntu-latest
timeout-minutes: 10
defaults:
run:
shell: bash -el {0}
steps:
- name: Checkout MODFLOW 6 examples
uses: actions/checkout@v6
- name: Setup pixi
uses: prefix-dev/setup-pixi@v0.9.6
with:
pixi-version: v0.41.4
- name: Check format
run: pixi run check-format
- name: Check spelling
run: pixi run check-spelling
dist:
name: Build example models
runs-on: ubuntu-latest
needs: lint
defaults:
run:
shell: bash -el {0}
steps:
- name: Checkout MODFLOW6 examples
uses: actions/checkout@v6
with:
path: modflow6-examples
- name: Checkout MODFLOW 6
uses: actions/checkout@v6
with:
repository: MODFLOW-ORG/modflow6
path: modflow6
- name: Setup pixi
uses: prefix-dev/setup-pixi@v0.9.6
with:
pixi-version: v0.41.4
manifest-path: modflow6-examples/pixi.toml
- name: Create Jupyter kernel
working-directory: modflow6-examples
run: pixi run python -m ipykernel install --name python_kernel --user
- name: Update FloPy classes
working-directory: modflow6-examples
run: pixi run update-flopy --releasemode
- name: Install MODFLOW executables
uses: modflowpy/install-modflow-action@v1
- name: Build MODFLOW 6
working-directory: modflow6
run: |
pixi run --manifest-path ../modflow6-examples/pixi.toml meson setup builddir -Ddebug=false --prefix=$(pwd) --libdir=bin
pixi run --manifest-path ../modflow6-examples/pixi.toml meson install -C builddir
pixi run --manifest-path ../modflow6-examples/pixi.toml meson test --verbose --no-rebuild -C builddir
- name: Install MODFLOW 6
working-directory: modflow6
run: cp bin/mf6 ~/.local/bin/modflow/
- name: Create example models
working-directory: modflow6-examples/autotest
# run the scripts via pytest without running the models, just build input files
run: pixi run pytest -v -n=auto --durations=0 test_scripts.py --init
- name: Make zipfile
working-directory: modflow6-examples
run: |
import shutil
shutil.make_archive("${{ env.DISTNAME }}", "zip", "examples")
shell: python
- name: Upload zipfile
uses: actions/upload-artifact@v7
with:
name: ${{ env.DISTNAME }}.zip
path: modflow6-examples/${{ env.DISTNAME }}.zip
docs:
name: Run examples, make docs
runs-on: ubuntu-latest
needs: lint
defaults:
run:
shell: bash -el {0}
env:
MPLBACKEND: agg
steps:
- name: Checkout MODFLOW 6 examples
uses: actions/checkout@v6
with:
path: modflow6-examples
- name: Checkout MODFLOW 6
uses: actions/checkout@v6
with:
repository: MODFLOW-ORG/modflow6
path: modflow6
- name: Checkout usgslatex
uses: actions/checkout@v6
with:
repository: MODFLOW-ORG/usgslatex
path: usgslatex
- name: Setup pixi
uses: prefix-dev/setup-pixi@v0.9.6
with:
pixi-version: v0.41.4
manifest-path: modflow6-examples/pixi.toml
- name: Install LaTeX and extra fonts
run: |
sudo apt-get update
sudo apt install texlive-latex-extra texlive-science fonts-liberation
- name: Install USGS styles and fonts
working-directory: usgslatex/usgsLaTeX
run: sudo ./install.sh --all-users
- name: Set up headless display
uses: pyvista/setup-headless-display-action@v4
- name: Create Jupyter kernel
working-directory: modflow6-examples
run: pixi run python -m ipykernel install --name python_kernel --user
- name: Update FloPy classes
working-directory: modflow6-examples
run: pixi run update-flopy --releasemode
- name: Install MODFLOW executables
uses: modflowpy/install-modflow-action@v1
- name: Build MODFLOW 6
working-directory: modflow6
run: |
pixi run --manifest-path ../modflow6-examples/pixi.toml meson setup builddir -Ddebug=false --prefix=$(pwd) --libdir=bin
pixi run --manifest-path ../modflow6-examples/pixi.toml meson install -C builddir
pixi run --manifest-path ../modflow6-examples/pixi.toml meson test --verbose --no-rebuild -C builddir
- name: Install MODFLOW 6
working-directory: modflow6
run: cp bin/mf6 ~/.local/bin/modflow/
- name: Run examples, make plots
working-directory: modflow6-examples/autotest
run: pixi run pytest -v -n=auto --durations=0 test_scripts.py --plot
- name: Run postprocessing
working-directory: modflow6-examples/scripts
run: pixi run python create-doc-tables.py
- name: Build PDF document
working-directory: modflow6-examples/doc
run: ./build-pdf.sh
- name: Move PDF document
working-directory: modflow6-examples
run: mv doc/${{ env.DISTNAME }}.pdf ${{ env.DISTNAME }}.pdf
- name: Upload PDF document
uses: actions/upload-artifact@v7
with:
name: ${{ env.DISTNAME}}.pdf
path: modflow6-examples/${{ env.DISTNAME }}.pdf