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..7d479c57d5 --- /dev/null +++ b/.github/workflows/rtd.yml @@ -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 }}