rtd #1728
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
name: rtd | |
on: | |
schedule: | |
- cron: '0 2 * * *' # run at 2 AM UTC | |
push: | |
paths-ignore: | |
- 'README.md' | |
- 'DEVELOPER.md' | |
pull_request: | |
branches: | |
- master | |
- develop | |
paths-ignore: | |
- 'README.md' | |
- 'DEVELOPER.md' | |
jobs: | |
rtd_build: | |
name: rtd-build | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
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 | |
echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections | |
sudo apt-get install ttf-mscorefonts-installer | |
sudo rm -rf ~/.cache/matplotlib | |
- 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@v5 | |
with: | |
python-version: 3.9 | |
- name: Install Python packages | |
working-directory: etc | |
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 | |
- name: Update flopy MODFLOW 6 classes | |
run: python -m flopy.mf6.utils.generate_classes --ref develop --no-backup | |
- 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: Create notebooks and run models | |
working-directory: autotest | |
run: pytest -v -n=auto --durations=0 test_notebooks.py --plot | |
- name: Copy notebooks to RTD directory | |
run: cp -R notebooks/*.ipynb .doc/_notebooks/ | |
- name: Run processing script | |
working-directory: scripts | |
run: python process-scripts.py | |
- name: Create package tables and examples.rst for ReadtheDocs | |
working-directory: etc | |
run: python ci_create_examples_rst.py | |
- 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' | |
steps: | |
- name: Checkout MODFLOW6 examples repo | |
uses: actions/checkout@v4 | |
- name: Trigger RTDs build | |
uses: dfm/rtds-action@v1 | |
with: | |
webhook_url: ${{ secrets.RTDS_WEBHOOK_URL }} | |
webhook_token: ${{ secrets.RTDS_WEBHOOK_TOKEN }} | |
commit_ref: ${{ github.ref }} |