-
Notifications
You must be signed in to change notification settings - Fork 317
105 lines (88 loc) · 2.99 KB
/
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
name: FloPy documentation
on:
push:
branches:
- master
- develop
- release*
- ci-diagnose*
- notebooks*
pull_request:
branches:
- master
- develop
jobs:
rtd_build:
name: Prepare and test notebooks
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
defaults:
run:
shell: bash
steps:
- name: Checkout flopy repo
uses: actions/checkout@v4
- name: Output repo information
run: |
echo $GITHUB_REPOSITORY_OWNER
echo $GITHUB_REPOSITORY
echo $GITHUB_REF
echo $GITHUB_EVENT_NAME
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.8
cache: 'pip'
cache-dependency-path: pyproject.toml
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Install flopy and dependencies
run: pip install ".[test, doc, optional]"
- name: Workaround OpenGL issue on Linux
if: runner.os == 'Linux'
run: |
# referenced from https://github.com/pyvista/pyvista/blob/main/.github/workflows/vtk-pre-test.yml#L53
pip uninstall -y vtk
pip install --extra-index-url https://wheels.vtk.org trame vtk-osmesa
- name: Install fonts on Linux
if: runner.os == 'Linux'
run: |
echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections
sudo apt-get install ttf-mscorefonts-installer fonts-liberation
sudo rm -rf ~/.cache/matplotlib
- name: Install OpenGL on Windows
if: runner.os == 'Windows'
shell: pwsh
run: |
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
$PSDefaultParameterValues['*:ErrorAction']='Stop'
powershell .github/install_opengl.ps1
- name: Install MODFLOW executables
uses: modflowpy/install-modflow-action@v1
- name: Run tutorial and example notebooks
working-directory: autotest
run: pytest -v -n auto test_notebooks.py
- name: Upload notebooks artifact for ReadtheDocs
if: github.repository_owner == 'modflowpy' && github.event_name == 'push' && runner.os == 'Linux'
uses: actions/upload-artifact@v3
with:
name: notebooks-for-${{ github.sha }}
path: .docs/Notebooks/*.ipynb
# trigger rtd if previous job was successful
rtd:
name: Read the Docs trigger
needs: rtd_build
runs-on: ubuntu-latest
if:
github.repository_owner == 'modflowpy' && github.event_name == 'push'
steps:
- name: Trigger RTDs build on master and develop branches
uses: dfm/rtds-action@v1
with:
webhook_url: ${{ secrets.RTDS_WEBHOOK_URL }}
webhook_token: ${{ secrets.RTDS_WEBHOOK_TOKEN }}
commit_ref: ${{ github.ref }}