From a0bd7ddede4cede942add9556dcbb8f435b1bfad Mon Sep 17 00:00:00 2001 From: jdhughes-usgs Date: Sat, 29 Aug 2020 08:15:19 -0400 Subject: [PATCH 1/2] ci(rtd): make separate rtd workflow --- .github/workflows/ci.yml | 58 ----------------------- .github/workflows/rtd.yml | 99 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+), 58 deletions(-) create mode 100644 .github/workflows/rtd.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 03873d2ddc..d4b34e33d7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -110,23 +110,11 @@ jobs: run: | conda install -n flopy -c conda-forge jupyter nbconvert - - name: Add jupyter and jupytext to scripts run - if: matrix.run-type == 'script' - 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: Determine python environment - shell: bash -l {0} - run: | - conda info - conda list - - name: Install pymake, xmipy, and flopy shell: bash -l {0} run: | @@ -151,53 +139,7 @@ jobs: --with-coverage --cover-package=flopy --cover-xml \ --cover-xml-file=../coverage.xml -w ./autotest ${{ matrix.test-path }} - - name: List files in the root directory - shell: bash - run: | - ls -l - - name: Upload coverage to Codecov uses: codecov/codecov-action@v1.0.12 with: file: ./coverage.xml - - - name: Run jupytext on tutorials - if: matrix.run-type == 'script' - shell: bash -l {0} - run: | - cd .docs/ - python tutorials2ipynb.py - cd ../ - - - name: Upload completed jupyter notebooks as an artifact for ReadtheDocs - if: matrix.run-type == 'script' && github.repository_owner == 'modflowpy' - uses: actions/upload-artifact@v2 - with: - name: notebooks-for-${{ github.sha }} - path: | - .docs/_notebooks - - # trigger rtd if previous job was successful - rtd: - name: ReadtheDocs - needs: flopyCI - runs-on: ubuntu-latest - - if: github.repository_owner == 'modflowpy' - steps: - - name: Checkout flopy repo - uses: actions/checkout@v2 - - - name: Output repo information - run: | - echo ${{ github.repository_owner }} - echo ${{ github.repository }} - echo ${{ github.ref }} - - - name: Trigger RTDs build on master and develop branches - if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' - uses: dfm/rtds-action@v1.0.0 - with: - webhook_url: ${{ secrets.RTDS_WEBHOOK_URL }} - webhook_token: ${{ secrets.RTDS_WEBHOOK_TOKEN }} - commit_ref: ${{ github.ref }} diff --git a/.github/workflows/rtd.yml b/.github/workflows/rtd.yml new file mode 100644 index 0000000000..6a246462c1 --- /dev/null +++ b/.github/workflows/rtd.yml @@ -0,0 +1,99 @@ +name: Read the Docs + +on: + push: + branches: [master, develop] + pull_request: + branches: [develop] + +jobs: + + build: + name: autotests + needs: flopy_lint + 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 + use-only-tar-bz2: true + + - 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(' + refs/heads/master + refs/heads/develop + ', github.ref) + 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 }} From c9374071a69f047017f2545771a48c6c30a7920e Mon Sep 17 00:00:00 2001 From: jdhughes-usgs Date: Sat, 29 Aug 2020 08:26:54 -0400 Subject: [PATCH 2/2] ci(rtd): make separate rtd workflow --- .github/workflows/rtd.yml | 112 +++++++++++++++++++------------------- 1 file changed, 55 insertions(+), 57 deletions(-) diff --git a/.github/workflows/rtd.yml b/.github/workflows/rtd.yml index 6a246462c1..7d479c57d5 100644 --- a/.github/workflows/rtd.yml +++ b/.github/workflows/rtd.yml @@ -9,81 +9,79 @@ on: jobs: build: - name: autotests - needs: flopy_lint + name: rtd runs-on: ubuntu-latest strategy: fail-fast: false steps: - # check out repo - - name: Checkout flopy repo - uses: actions/checkout@v2 + # 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 + - 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 - use-only-tar-bz2: true + # 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 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: 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: 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: 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: 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: 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 + - name: Upload completed jupyter notebooks as an artifact for ReadtheDocs if: github.repository_owner == 'modflowpy' && - contains(' + contains(github.ref, ' refs/heads/master refs/heads/develop - ', github.ref) - uses: actions/upload-artifact@v2 - with: - name: notebooks-for-${{ github.sha }} - path: | - .docs/_notebooks + ') + uses: actions/upload-artifact@v2 + with: + name: notebooks-for-${{ github.sha }} + path: | + .docs/_notebooks - name: Trigger RTDs build on master and develop branches if: