refactor: run nbQA tools pyupgrade, isort and black #1364
Workflow file for this run
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: | |
branches: [ master ] | |
paths-ignore: | |
- 'README.md' | |
- 'DEVELOPER.md' | |
pull_request: | |
branches: [ master ] | |
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 | |
if: github.repository_owner == 'MODFLOW-USGS' | |
steps: | |
- name: Checkout MODFLOW6 examples repo | |
uses: actions/checkout@v3 | |
- 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' | |
steps: | |
- name: Checkout MODFLOW6 examples repo | |
uses: actions/checkout@v3 | |
- 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 }} |