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: MODFLOW 6 documentation | |
on: | |
push: | |
paths-ignore: | |
- '.github/workflows/release.yml' | |
- '.github/workflows/ci.yml' | |
- '.hpc/**' | |
pull_request: | |
branches: | |
- master | |
- develop | |
paths-ignore: | |
- '.github/workflows/release.yml' | |
- '.hpc/**' | |
jobs: | |
rtd_build: | |
name: Build ReadTheDocs | |
runs-on: ubuntu-22.04 | |
defaults: | |
run: | |
shell: bash -l {0} | |
env: | |
FC: gfortran | |
FC_V: 12 | |
steps: | |
- name: Checkout modflow6 | |
uses: actions/checkout@v4 | |
with: | |
path: modflow6 | |
- name: Checkout modflow6-examples | |
uses: actions/checkout@v4 | |
with: | |
repository: MODFLOW-USGS/modflow6-examples | |
path: modflow6-examples | |
- name: Checkout usgslatex | |
uses: actions/checkout@v4 | |
with: | |
repository: MODFLOW-USGS/usgslatex | |
path: usgslatex | |
- uses: prefix-dev/setup-pixi@v0.5.1 | |
with: | |
pixi-version: "latest" | |
manifest-path: "modflow6/pixi.toml" | |
- name: Setup pixi | |
working-directory: modflow6 | |
run: pixi run install | |
- name: Install additional packages for Sphinx using pip | |
working-directory: modflow6/.build_rtd_docs | |
run: pixi run pip install -r requirements.rtd.txt | |
- name: Print python package versions | |
run: pixi run pip list | |
- name: Install TeX Live | |
run: | | |
sudo apt-get update | |
sudo apt install texlive-latex-extra texlive-science texlive-font-utils | |
- name: Install USGS LaTeX style files and Univers font | |
working-directory: usgslatex/usgsLaTeX | |
run: sudo ./install.sh --all-users | |
- name: Test building files from dfn's for LaTeX | |
working-directory: modflow6/autotest | |
run: pixi run pytest -v build_mfio_tex.py | |
- name: Setup ${{ env.FC }} ${{ env.FC_V }} | |
uses: fortran-lang/setup-fortran@v1 | |
with: | |
compiler: gcc | |
version: ${{ env.FC_V }} | |
- name: Cache modflow6 examples | |
id: cache-examples | |
uses: actions/cache@v4 | |
with: | |
path: modflow6-examples/examples | |
key: modflow6-examples-${{ hashFiles('modflow6-examples/scripts/**') }} | |
- name: Install extra Python packages | |
if: steps.cache-examples.outputs.cache-hit != 'true' | |
working-directory: modflow6-examples/etc | |
run: | | |
pixi run pip install -r requirements.pip.txt | |
pixi run pip install -r requirements.usgs.txt | |
- name: Update FloPy | |
if: steps.cache-examples.outputs.cache-hit != 'true' | |
working-directory: modflow6/autotest | |
run: pixi run update-flopy | |
- name: Build example models | |
if: steps.cache-examples.outputs.cache-hit != 'true' | |
working-directory: modflow6-examples/autotest | |
run: | | |
pixi run pytest -v -n auto test_scripts.py --init | |
ls -lh ../examples/ | |
- name: Run benchmarks | |
working-directory: modflow6/distribution | |
run: python benchmark.py | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
- name: Show benchmarks | |
working-directory: modflow6/distribution | |
run: cat run-time-comparison.md | |
- name: Upload benchmarks | |
uses: actions/upload-artifact@v3 | |
with: | |
name: run-time-comparison | |
path: modflow6/distribution/run-time-comparison.md | |
- name: Collect deprecations | |
working-directory: modflow6/doc/mf6io/mf6ivar | |
run: pixi run deprecations | |
- name: Show deprecations | |
working-directory: modflow6/doc/mf6io/mf6ivar/md | |
run: cat deprecations.md | |
- name: Upload deprecations | |
uses: actions/upload-artifact@v3 | |
with: | |
name: deprecations | |
path: modflow6/doc/mf6io/mf6ivar/md/deprecations.md | |
- name: Run sphinx | |
working-directory: modflow6/.build_rtd_docs | |
run: make html | |
- name: Upload results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: rtd-files-for-${{ github.sha }} | |
path: | | |
modflow6/.build_rtd_docs/index.rst | |
modflow6/.build_rtd_docs/mf6io.rst | |
# run-time-comparison is moved to _mf6run by conf.py | |
modflow6/.build_rtd_docs/_mf6run/ | |
modflow6/.build_rtd_docs/_mf6io/ | |
modflow6/.build_rtd_docs/_static/ | |
rtd_trigger: | |
name: rtd-trigger | |
needs: rtd_build | |
runs-on: ubuntu-22.04 | |
if: github.repository_owner == 'MODFLOW-USGS' && github.event_name == 'push' | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Trigger RTDs build on push to repo branches | |
uses: dfm/rtds-action@v1 | |
with: | |
webhook_url: ${{ secrets.MF6_RTDS_WEBHOOK_URL }} | |
webhook_token: ${{ secrets.MF6_RTDS_WEBHOOK_TOKEN }} | |
commit_ref: ${{ github.ref }} | |
doxygen_build: | |
runs-on: ubuntu-22.04 | |
env: | |
working-directory: .build_rtd_docs | |
common-directory: .github/common | |
branch-name: ${GITHUB_REF##*/} | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Print branch name | |
run: echo ${{env.branch-name}} | |
- name: Install doxygen and graphviz | |
run: | | |
sudo apt-get update | |
sudo apt-get install doxygen graphviz | |
- uses: prefix-dev/setup-pixi@v0.5.1 | |
with: | |
pixi-version: "latest" | |
- name: Setup pixi | |
run: pixi run install | |
- name: Print python package versions | |
run: pixi run pip list | |
- name: update MODFLOW 6 version | |
run: pixi run update-version | |
- name: update MODFLOW 6 version in Doxyfile | |
run: pixi run update-doxyfile-version | |
- name: run doxygen | |
run: doxygen | |
working-directory: ${{env.working-directory}} | |
- name: upload pages artifact | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
path: ${{env.working-directory}}/html | |
pages_deploy: | |
if: github.ref == 'refs/heads/develop' && github.event_name == 'push' | |
needs: doxygen_build | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v3 |