Skip to content

Commit

Permalink
Delete testing part from Docs workflow and only build docs with Pytho…
Browse files Browse the repository at this point in the history
…n 3.9
  • Loading branch information
seisman committed Mar 10, 2021
1 parent 2b1cfbd commit 4578d0a
Showing 1 changed file with 12 additions and 47 deletions.
59 changes: 12 additions & 47 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,31 @@
# This workflow installs PyGMT dependencies, build documentation and run tests
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
# This workflow installs PyGMT, builds and deploys documentation

name: Tests
name: Docs

on:
push:
branches: [ master ]
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
paths-ignore:
- 'doc/**'
- '*.md'
- '*.json'
paths:
- '.github/workflows/**'
- 'README.rst'
- 'LICENSE.txt'
- 'doc/**'
- 'examples/**'
- 'pygmt/**'
- '!pygmt/tests/**'
release:
types:
- published
# Schedule daily tests
schedule:
- cron: '0 0 * * *'

jobs:
test:
docs:
name: ${{ matrix.os }} - Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: [3.9]
os: [ubuntu-latest, macOS-latest, windows-latest]
# Is it a draft Pull Request (true or false)?
isDraft:
Expand All @@ -39,17 +36,6 @@ jobs:
isDraft: true
- os: windows-latest
isDraft: true
- os: ubuntu-latest
python-version: 3.7
isDraft: true
- os: ubuntu-latest
python-version: 3.8
isDraft: true

# environmental variables used in coverage
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}

steps:
# Cancel previous runs that are not completed
Expand Down Expand Up @@ -110,32 +96,11 @@ jobs:
python setup.py sdist --formats=zip
pip install dist/*
# Run the tests
- name: Test with pytest
shell: bash -l {0}
run: make test PYTEST_EXTRA="-r P"

# Upload diff images on test failure
- name: Upload diff images if any test fails
uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: artifact-${{ runner.os }}-${{ matrix.python-version }}
path: tmp-test-dir-with-unique-name

# Build the documentation
- name: Build the documentation
shell: bash -l {0}
run: make -C doc clean all

# Upload coverage to Codecov
- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
file: ./coverage.xml # optional
env_vars: OS,PYTHON
fail_ci_if_error: false

- name: Checkout the gh-pages branch
uses: actions/checkout@28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b
with:
Expand All @@ -144,7 +109,7 @@ jobs:
path: deploy
# Download the entire history
fetch-depth: 0
if: (github.event_name == 'release' || github.event_name == 'push') && (matrix.os == 'ubuntu-latest') && (matrix.python-version == '3.9')
if: (github.event_name == 'release' || github.event_name == 'push') && (matrix.os == 'ubuntu-latest')

- name: Push the built HTML to gh-pages
run: |
Expand Down Expand Up @@ -195,4 +160,4 @@ jobs:
echo -e "\nPushing changes to gh-pages."
git push -fq origin gh-pages 2>&1 >/dev/null
echo -e "\nFinished uploading generated files."
if: (github.event_name == 'release' || github.event_name == 'push') && (matrix.os == 'ubuntu-latest') && (matrix.python-version == '3.9')
if: (github.event_name == 'release' || github.event_name == 'push') && (matrix.os == 'ubuntu-latest')

0 comments on commit 4578d0a

Please sign in to comment.