-
Notifications
You must be signed in to change notification settings - Fork 322
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(rtd): make separate rtd workflow (#980)
- Loading branch information
1 parent
893bd11
commit ebb7a8f
Showing
2 changed files
with
97 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
name: Read the Docs | ||
|
||
on: | ||
push: | ||
branches: [master, develop] | ||
pull_request: | ||
branches: [develop] | ||
|
||
jobs: | ||
|
||
build: | ||
name: rtd | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
|
||
steps: | ||
# check out repo | ||
- name: Checkout flopy repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Output repo information | ||
run: | | ||
echo $GITHUB_REPOSITORY_OWNER | ||
echo $GITHUB_REPOSITORY | ||
echo $GITHUB_REF | ||
echo $GITHUB_EVENT_NAME | ||
# Standard python fails on windows without GDAL installation | ||
# Using custom bash shell ("shell: bash -l {0}") with Miniconda | ||
- name: Setup Miniconda | ||
uses: goanpeca/setup-miniconda@v1.6.0 | ||
with: | ||
python-version: 3.8 | ||
auto-update-conda: true | ||
auto-activate-base: true | ||
activate-environment: flopy | ||
|
||
- name: Add jupyter and jupytext to scripts run | ||
shell: bash -l {0} | ||
run: | | ||
conda install -n flopy -c conda-forge jupyter jupytext | ||
- name: Add packages to flopy environment | ||
shell: bash -l {0} | ||
run: | | ||
conda env update --name flopy --file etc/environment.yml | ||
- name: Install pymake, xmipy, and flopy | ||
shell: bash -l {0} | ||
run: | | ||
pip install https://github.com/modflowpy/pymake/zipball/master | ||
pip install xmipy | ||
pip install . | ||
- name: Download executables needed for tests | ||
shell: bash -l {0} | ||
run: | | ||
python ./autotest/get_exes.py | ||
- name: Add executables directory to path | ||
shell: bash | ||
run: | | ||
echo "::add-path::$HOME/.local/bin" | ||
- name: Run jupytext on tutorials | ||
shell: bash -l {0} | ||
run: | | ||
cd .docs/ | ||
python tutorials2ipynb.py | ||
cd ../ | ||
- name: Upload completed jupyter notebooks as an artifact for ReadtheDocs | ||
if: | ||
github.repository_owner == 'modflowpy' && | ||
contains(github.ref, ' | ||
refs/heads/master | ||
refs/heads/develop | ||
') | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: notebooks-for-${{ github.sha }} | ||
path: | | ||
.docs/_notebooks | ||
- name: Trigger RTDs build on master and develop branches | ||
if: | ||
github.repository_owner == 'modflowpy' && | ||
contains(' | ||
refs/heads/master | ||
refs/heads/develop | ||
', github.ref) | ||
uses: dfm/rtds-action@v1.0.0 | ||
with: | ||
webhook_url: ${{ secrets.RTDS_WEBHOOK_URL }} | ||
webhook_token: ${{ secrets.RTDS_WEBHOOK_TOKEN }} | ||
commit_ref: ${{ github.ref }} |