-
Notifications
You must be signed in to change notification settings - Fork 43
134 lines (112 loc) · 3.89 KB
/
ex-rtd.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
name: rtd
on:
schedule:
- cron: '0 2 * * *' # run at 2 AM UTC
push:
branches:
- master
- develop
- ci-*
paths-ignore:
- 'README.md'
- 'DEVELOPER.md'
pull_request:
branches:
- master
- develop
jobs:
rtd_build:
name: rtd-build
runs-on: ubuntu-latest
strategy:
fail-fast: false
env:
script-directory: scripts
etc-directory: etc
defaults:
run:
shell: bash
steps:
- name: Checkout MODFLOW6 examples repo
uses: actions/checkout@v4
- name: Output repo information
run: |
echo ${{ github.repository_owner }}
echo ${{ github.repository }}
echo ${{ github.ref }}
echo ${{ github.event_name }}
echo ${{ github.sha }}
- name: Install TeX Live and additional TrueType fonts
run: |
sudo apt-get update
sudo apt install texlive-latex-extra texlive-science fonts-liberation
- name: Install pandoc
run: |
wget https://github.com/jgm/pandoc/releases/download/2.11.2/pandoc-2.11.2-linux-amd64.tar.gz
sudo tar xvzf pandoc-2.11.2-linux-amd64.tar.gz --strip-components=1 -C /usr/local
pandoc --version
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install Python packages
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements.pip.txt
pip install -r requirements.usgs.txt
python -m ipykernel install --name python_kernel --user
working-directory: ${{env.etc-directory}}
- name: Update flopy MODFLOW 6 classes
run: |
import flopy
flopy.mf6.utils.generate_classes(branch="develop", backup=False)
shell: python
- name: Install MODFLOW executables release
uses: modflowpy/install-modflow-action@v1
- name: Install MODFLOW nightly-build executables
uses: modflowpy/install-modflow-action@v1
with:
repo: modflow6-nightly-build
- name: Run scripts without model runs
run: pytest -v -n=auto --durations=0 ci_build_files.py
working-directory: ${{env.etc-directory}}
- name: Run processing script
run: python process-scripts.py
working-directory: ${{env.script-directory}}
- name: Run notebooks with jupytext for ReadtheDocs
run: pytest -v -n=auto --durations=0 ci_run_notebooks.py
working-directory: ${{env.etc-directory}}
- name: Create package tables and examples.rst for ReadtheDocs
run: python ci_create_examples_rst.py
working-directory: ${{env.etc-directory}}
- name: List example rst files for ReadtheDocs
run: ls -R .doc/_examples/
- name: List example image files for ReadtheDocs
run: ls -R .doc/_images/
- name: List example notebook files for ReadtheDocs
run: ls -R .doc/_notebooks/
- name: Upload completed jupyter notebooks as an artifact for ReadtheDocs
uses: actions/upload-artifact@v3
with:
name: rtd-files-for-${{ github.sha }}
path: |
.doc/introduction.md
.doc/examples.rst
.doc/_examples
.doc/_images
.doc/_notebooks
# trigger rtd if "rtd_build" job was successful
rtd_trigger:
name: rtd-trigger
needs: rtd_build
runs-on: ubuntu-latest
if: github.repository_owner == 'MODFLOW-USGS' && github.event_name == 'push' && github.ref_name == 'master'
steps:
- name: Checkout MODFLOW6 examples repo
uses: actions/checkout@v4
- name: Trigger RTDs build on push to repo branches
uses: dfm/rtds-action@v1
with:
webhook_url: ${{ secrets.RTDS_WEBHOOK_URL }}
webhook_token: ${{ secrets.RTDS_WEBHOOK_TOKEN }}
commit_ref: ${{ github.ref }}