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 :
15
11
- ' README.rst'
16
- - ' LICENSE.txt'
12
+ - ' doc/**'
13
+ - ' examples/**'
14
+ - ' pygmt/**'
15
+ - ' !pygmt/tests/**'
17
16
release :
18
17
types :
19
18
- published
20
- # Schedule daily tests
21
- schedule :
22
- - cron : ' 0 0 * * *'
23
19
24
20
jobs :
25
- test :
21
+ docs :
26
22
name : ${{ matrix.os }} - Python ${{ matrix.python-version }}
27
23
runs-on : ${{ matrix.os }}
28
24
strategy :
29
25
fail-fast : false
30
26
matrix :
31
- python-version : [3.7, 3.8, 3. 9]
27
+ python-version : [3.9]
32
28
os : [ubuntu-latest, macOS-latest, windows-latest]
33
29
# Is it a draft Pull Request (true or false)?
34
30
isDraft :
39
35
isDraft : true
40
36
- os : windows-latest
41
37
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
38
54
39
steps :
55
40
# Cancel previous runs that are not completed
@@ -110,32 +95,11 @@ jobs:
110
95
python setup.py sdist --formats=zip
111
96
pip install dist/*
112
97
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
98
# Build the documentation
127
99
- name : Build the documentation
128
100
shell : bash -l {0}
129
101
run : make -C doc clean all
130
102
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
103
- name : Checkout the gh-pages branch
140
104
uses : actions/checkout@28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b
141
105
with :
@@ -144,7 +108,7 @@ jobs:
144
108
path : deploy
145
109
# Download the entire history
146
110
fetch-depth : 0
147
- if : (github.event_name == 'release' || github.event_name == 'push') && (matrix.os == 'ubuntu-latest') && (matrix.python-version == '3.9')
111
+ if : (github.event_name == 'release' || github.event_name == 'push') && (matrix.os == 'ubuntu-latest')
148
112
149
113
- name : Push the built HTML to gh-pages
150
114
run : |
@@ -195,4 +159,4 @@ jobs:
195
159
echo -e "\nPushing changes to gh-pages."
196
160
git push -fq origin gh-pages 2>&1 >/dev/null
197
161
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')
162
+ if : (github.event_name == 'release' || github.event_name == 'push') && (matrix.os == 'ubuntu-latest')
0 commit comments