1
- # This workflow installs PyGMT dependencies, build documentation and run tests
2
- # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
1
+ # This workflow installs PyGMT, builds and deploys documentation
3
2
4
- name : Tests
3
+ name : Docs
5
4
6
5
on :
7
6
push :
8
7
branches : [ master ]
9
8
pull_request :
10
9
types : [opened, reopened, synchronize, ready_for_review]
11
- paths-ignore :
12
- - ' doc/**'
13
- - ' *.md'
14
- - ' *.json'
10
+ paths :
11
+ - ' .github/workflows/**'
15
12
- ' README.rst'
16
- - ' LICENSE.txt'
13
+ - ' doc/**'
14
+ - ' examples/**'
15
+ - ' pygmt/**'
16
+ - ' !pygmt/tests/**'
17
17
release :
18
18
types :
19
19
- published
20
- # Schedule daily tests
21
- schedule :
22
- - cron : ' 0 0 * * *'
23
20
24
21
jobs :
25
- test :
22
+ docs :
26
23
name : ${{ matrix.os }} - Python ${{ matrix.python-version }}
27
24
runs-on : ${{ matrix.os }}
28
25
strategy :
29
26
fail-fast : false
30
27
matrix :
31
- python-version : [3.7, 3.8, 3. 9]
28
+ python-version : [3.9]
32
29
os : [ubuntu-latest, macOS-latest, windows-latest]
33
30
# Is it a draft Pull Request (true or false)?
34
31
isDraft :
39
36
isDraft : true
40
37
- os : windows-latest
41
38
isDraft : true
42
- - os : ubuntu-latest
43
- python-version : 3.7
44
- isDraft : true
45
- - os : ubuntu-latest
46
- python-version : 3.8
47
- isDraft : true
48
-
49
- # environmental variables used in coverage
50
- env :
51
- OS : ${{ matrix.os }}
52
- PYTHON : ${{ matrix.python-version }}
53
39
54
40
steps :
55
41
# Cancel previous runs that are not completed
@@ -110,32 +96,11 @@ jobs:
110
96
python setup.py sdist --formats=zip
111
97
pip install dist/*
112
98
113
- # Run the tests
114
- - name : Test with pytest
115
- shell : bash -l {0}
116
- run : make test PYTEST_EXTRA="-r P"
117
-
118
- # Upload diff images on test failure
119
- - name : Upload diff images if any test fails
120
- uses : actions/upload-artifact@v2
121
- if : ${{ failure() }}
122
- with :
123
- name : artifact-${{ runner.os }}-${{ matrix.python-version }}
124
- path : tmp-test-dir-with-unique-name
125
-
126
99
# Build the documentation
127
100
- name : Build the documentation
128
101
shell : bash -l {0}
129
102
run : make -C doc clean all
130
103
131
- # Upload coverage to Codecov
132
- - name : Upload coverage to Codecov
133
-
134
- with :
135
- file : ./coverage.xml # optional
136
- env_vars : OS,PYTHON
137
- fail_ci_if_error : false
138
-
139
104
- name : Checkout the gh-pages branch
140
105
uses : actions/checkout@28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b
141
106
with :
@@ -144,7 +109,7 @@ jobs:
144
109
path : deploy
145
110
# Download the entire history
146
111
fetch-depth : 0
147
- if : (github.event_name == 'release' || github.event_name == 'push') && (matrix.os == 'ubuntu-latest') && (matrix.python-version == '3.9')
112
+ if : (github.event_name == 'release' || github.event_name == 'push') && (matrix.os == 'ubuntu-latest')
148
113
149
114
- name : Push the built HTML to gh-pages
150
115
run : |
@@ -195,4 +160,4 @@ jobs:
195
160
echo -e "\nPushing changes to gh-pages."
196
161
git push -fq origin gh-pages 2>&1 >/dev/null
197
162
echo -e "\nFinished uploading generated files."
198
- if : (github.event_name == 'release' || github.event_name == 'push') && (matrix.os == 'ubuntu-latest') && (matrix.python-version == '3.9')
163
+ if : (github.event_name == 'release' || github.event_name == 'push') && (matrix.os == 'ubuntu-latest')
0 commit comments