forked from MODFLOW-USGS/modflow6
-
Notifications
You must be signed in to change notification settings - Fork 1
273 lines (232 loc) · 7.43 KB
/
docs.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
name: MODFLOW 6 documentation
on:
push:
paths-ignore:
- '.github/workflows/release.yml'
- '.github/workflows/ci.yml'
- '.hpc/**'
pull_request:
branches:
- master
- develop
paths-ignore:
- '.github/workflows/release.yml'
- '.hpc/**'
env:
PIXI_BETA_WARNING_OFF: true
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Check format
runs-on: ubuntu-latest
steps:
- name: Checkout modflow6
uses: actions/checkout@v4
- uses: prefix-dev/setup-pixi@v0.8.1
with:
pixi-version: v0.24.2
- name: Check spelling
run: pixi run check-spelling
rtd_build:
name: Build ReadTheDocs
needs:
- lint
runs-on: ubuntu-22.04
defaults:
run:
shell: bash -l {0}
env:
FC: gfortran
FC_V: 12
steps:
- name: Checkout modflow6
uses: actions/checkout@v4
with:
path: modflow6
- name: Checkout modflow6-examples
uses: actions/checkout@v4
with:
repository: MODFLOW-USGS/modflow6-examples
path: modflow6-examples
- name: Checkout usgslatex
uses: actions/checkout@v4
with:
repository: MODFLOW-USGS/usgslatex
path: usgslatex
- 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: Print python package versions
working-directory: modflow6
run: pixi run pip list
- name: Install TeX Live
run: |
sudo apt-get update
sudo apt install texlive-science \
texlive-latex-extra \
texlive-font-utils \
texlive-fonts-recommended \
texlive-fonts-extra
- name: Install USGS LaTeX style files and Univers font
working-directory: usgslatex/usgsLaTeX
run: sudo ./install.sh --all-users
- name: Build MF6IO files from DFNs
working-directory: modflow6
run: pixi run run-mf6ivar
- name: Setup ${{ env.FC }} ${{ env.FC_V }}
uses: fortran-lang/setup-fortran@v1
with:
compiler: gcc
version: ${{ env.FC_V }}
- name: Cache modflow6 examples
id: cache-examples
uses: actions/cache@v4
with:
path: modflow6-examples/examples
key: modflow6-examples-${{ hashFiles('modflow6-examples/scripts/**') }}
- name: Install extra Python packages
if: steps.cache-examples.outputs.cache-hit != 'true'
working-directory: modflow6
run: |
pixi run pip install -r ../modflow6-examples/etc/requirements.pip.txt
pixi run pip install -r ../modflow6-examples/etc/requirements.usgs.txt
- name: Update FloPy
if: steps.cache-examples.outputs.cache-hit != 'true'
working-directory: modflow6/autotest
run: pixi run update-flopy
# the example models also need mf2005, triangle and gridgen
- name: Install extra executables
if: steps.cache-examples.outputs.cache-hit != 'true'
uses: modflowpy/install-modflow-action@v1
with:
subset: mf2005,triangle,gridgen
- name: Build example models
if: steps.cache-examples.outputs.cache-hit != 'true'
working-directory: modflow6
shell: pixi run bash -e {0}
run: |
cd ../modflow6-examples/autotest
pytest -v -n auto test_scripts.py --init
ls -lh ../examples/
- name: Run benchmarks
working-directory: modflow6
run: pixi run benchmark
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Show benchmarks
working-directory: modflow6/distribution
run: cat run-time-comparison.md
- name: Upload benchmarks
uses: actions/upload-artifact@v3
with:
name: run-time-comparison
path: modflow6/distribution/run-time-comparison.md
- name: Collect deprecations
working-directory: modflow6
run: pixi run deprecations
- name: Show deprecations
working-directory: modflow6/doc/mf6io/mf6ivar/md
run: cat deprecations.md
- name: Upload deprecations
uses: actions/upload-artifact@v3
with:
name: deprecations
path: modflow6/doc/mf6io/mf6ivar/md/deprecations.md
- name: Run sphinx
working-directory: modflow6
run: pixi run sphinx
- name: Upload RTD files
uses: actions/upload-artifact@v3
with:
name: rtd-files-for-${{ github.sha }}
path: |
modflow6/.build_rtd_docs/dev.rst
modflow6/.build_rtd_docs/index.rst
modflow6/.build_rtd_docs/mf6io.rst
modflow6/.build_rtd_docs/_dev/
modflow6/.build_rtd_docs/_mf6io/
modflow6/.build_rtd_docs/_mf6run/
modflow6/.build_rtd_docs/_static/
- name: Build PDF documents
working-directory: modflow6
run: pixi run build-docs
- name: Upload PDF documents
uses: actions/upload-artifact@v3
with:
name: mf6io.pdf
path: |
modflow6/mf6io.pdf
modflow6/ReleaseNotes.pdf
modflow6/zonebudget.pdf
modflow6/converter_mf5to6.pdf
modflow6/mf6suptechinfo.pdf
modflow6/mf6examples.pdf
rtd_trigger:
name: rtd-trigger
needs: rtd_build
runs-on: ubuntu-22.04
if: github.repository_owner == 'MODFLOW-USGS' && github.event_name == 'push'
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Trigger RTDs build on push to repo branches
uses: dfm/rtds-action@v1
with:
webhook_url: ${{ secrets.MF6_RTDS_WEBHOOK_URL }}
webhook_token: ${{ secrets.MF6_RTDS_WEBHOOK_TOKEN }}
commit_ref: ${{ github.ref }}
doxygen_build:
runs-on: ubuntu-22.04
env:
working-directory: .build_rtd_docs
common-directory: .github/common
branch-name: ${GITHUB_REF##*/}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- name: Print branch name
run: echo ${{env.branch-name}}
- name: Install doxygen and graphviz
run: |
sudo apt-get update
sudo apt-get install doxygen graphviz
- name: Setup pixi
uses: prefix-dev/setup-pixi@v0.8.1
with:
pixi-version: v0.24.2
- name: Custom pixi install
run: pixi run install
- name: Print python package versions
run: pixi run pip list
- name: update MODFLOW 6 version
run: pixi run update-version
- name: run doxygen
run: doxygen
working-directory: ${{env.working-directory}}
- name: upload pages artifact
uses: actions/upload-pages-artifact@v2
with:
path: ${{env.working-directory}}/html
pages_deploy:
if: github.ref == 'refs/heads/develop' && github.event_name == 'push'
needs: doxygen_build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v3