4
4
version : 2.1
5
5
6
6
7
- # ##########################################
8
- # Define some common steps as YAML anchors .
7
+ # ######################################
8
+ # Define some common steps as commands .
9
9
#
10
10
11
- apt-run : &apt-install
12
- name : Install apt packages
13
- command : |
14
- sudo apt -qq update
15
- sudo apt install -y \
16
- inkscape \
17
- ffmpeg \
18
- dvipng \
19
- lmodern \
20
- cm-super \
21
- texlive-latex-base \
22
- texlive-latex-extra \
23
- texlive-fonts-recommended \
24
- texlive-latex-recommended \
25
- texlive-pictures \
26
- texlive-xetex \
27
- graphviz \
28
- fonts-crosextra-carlito \
29
- fonts-freefont-otf \
30
- fonts-humor-sans \
31
- optipng
32
-
33
- fonts-run : &fonts-install
34
- name : Install custom fonts
35
- command : |
36
- mkdir -p ~/.local/share/fonts
37
- wget -nc https://github.com/google/fonts/blob/master/ofl/felipa/Felipa-Regular.ttf?raw=true -O ~/.local/share/fonts/Felipa-Regular.ttf || true
38
- fc-cache -f -v
39
- save_cache :
40
- key : fonts-2
41
- paths :
42
- - ~/.local/share/fonts/
43
- restore_cache :
44
- key : fonts-2
45
-
46
- pip-run : &pip-install
47
- # Upgrade pip and setuptools and wheel to get as clean an install as possible
48
- name : Upgrade pip, setuptools, wheel
49
- command : |
50
- python -mpip install --upgrade --user pip
51
- python -mpip install --upgrade --user wheel
52
- python -mpip install --upgrade --user setuptools
53
-
54
- deps-run : &deps-install
55
- name : Install Python dependencies
56
- command : |
57
- python -mpip install --user numpy${NUMPY_VERSION} codecov coverage
58
- python -mpip install --user -r requirements/doc/doc-requirements.txt
59
-
60
- mpl-run : &mpl-install
61
- name : Install Matplotlib
62
- command : python -mpip install --user -ve .
63
-
64
- doc-run : &doc-build
65
- name : Build documentation
66
- command : |
67
- # Set epoch to date of latest tag.
68
- export SOURCE_DATE_EPOCH="$(git log -1 --format=%at $(git describe --abbrev=0))"
69
- make html O=-T
70
- rm -r build/html/_sources
71
- working_directory : doc
72
-
73
- doc-bundle-run : &doc-bundle
74
- name : Bundle sphinx-gallery documentation artifacts
75
- command : tar cf doc/build/sphinx-gallery-files.tar.gz doc/api/_as_gen doc/gallery doc/tutorials
76
- when : always
11
+ commands :
12
+ apt-install :
13
+ steps :
14
+ - run :
15
+ name : Install apt packages
16
+ command : |
17
+ sudo apt -qq update
18
+ sudo apt install -y \
19
+ inkscape \
20
+ ffmpeg \
21
+ dvipng \
22
+ lmodern \
23
+ cm-super \
24
+ texlive-latex-base \
25
+ texlive-latex-extra \
26
+ texlive-fonts-recommended \
27
+ texlive-latex-recommended \
28
+ texlive-pictures \
29
+ texlive-xetex \
30
+ graphviz \
31
+ fonts-crosextra-carlito \
32
+ fonts-freefont-otf \
33
+ fonts-humor-sans \
34
+ optipng
35
+
36
+ fonts-install :
37
+ steps :
38
+ - restore_cache :
39
+ key : fonts-2
40
+ - run :
41
+ name : Install custom fonts
42
+ command : |
43
+ mkdir -p ~/.local/share/fonts
44
+ wget -nc https://github.com/google/fonts/blob/master/ofl/felipa/Felipa-Regular.ttf?raw=true -O ~/.local/share/fonts/Felipa-Regular.ttf || true
45
+ fc-cache -f -v
46
+ - save_cache :
47
+ key : fonts-2
48
+ paths :
49
+ - ~/.local/share/fonts/
50
+
51
+ pip-install :
52
+ description : Upgrade pip and setuptools and wheel to get as clean an install as possible
53
+ steps :
54
+ - run :
55
+ name : Upgrade pip, setuptools, wheel
56
+ command : |
57
+ python -mpip install --upgrade --user pip
58
+ python -mpip install --upgrade --user wheel
59
+ python -mpip install --upgrade --user setuptools
60
+
61
+ deps-install :
62
+ parameters :
63
+ numpy_version :
64
+ type : string
65
+ default : " "
66
+ steps :
67
+ - run :
68
+ name : Install Python dependencies
69
+ command : |
70
+ python -mpip install --user numpy<< parameters.numpy_version >> codecov coverage
71
+ python -mpip install --user -r requirements/doc/doc-requirements.txt
72
+
73
+ mpl-install :
74
+ steps :
75
+ - run :
76
+ name : Install Matplotlib
77
+ command : python -mpip install --user -ve .
78
+
79
+ doc-build :
80
+ steps :
81
+ - restore_cache :
82
+ keys :
83
+ - sphinx-env-v1-{{ .BuildNum }}-{{ .Environment.CIRCLE_JOB }}
84
+ - sphinx-env-v1-{{ .Environment.CIRCLE_PREVIOUS_BUILD_NUM }}-{{ .Environment.CIRCLE_JOB }}
85
+ - run :
86
+ name : Build documentation
87
+ command : |
88
+ # Set epoch to date of latest tag.
89
+ export SOURCE_DATE_EPOCH="$(git log -1 --format=%at $(git describe --abbrev=0))"
90
+ make html O=-T
91
+ rm -r build/html/_sources
92
+ working_directory : doc
93
+ - save_cache :
94
+ key : sphinx-env-v1-{{ .BuildNum }}-{{ .Environment.CIRCLE_JOB }}
95
+ paths :
96
+ - doc/build/doctrees
97
+
98
+ doc-bundle :
99
+ steps :
100
+ - run :
101
+ name : Bundle sphinx-gallery documentation artifacts
102
+ command : tar cf doc/build/sphinx-gallery-files.tar.gz doc/api/_as_gen doc/gallery doc/tutorials
103
+ when : always
104
+ - store_artifacts :
105
+ path : doc/build/sphinx-gallery-files.tar.gz
77
106
78
107
79
108
# #########################################
@@ -87,20 +116,16 @@ jobs:
87
116
steps :
88
117
- checkout
89
118
90
- - run : *apt-install
91
- - run : *fonts-install
92
- - run : *pip-install
93
- - run :
94
- << : *deps-install
95
- environment :
96
- NUMPY_VERSION : " ==1.13.0"
97
- - run : *mpl-install
119
+ - apt-install
120
+ - fonts-install
121
+ - pip-install
122
+ - deps-install :
123
+ numpy_version : " ==1.13.0"
124
+ - mpl-install
98
125
99
- - run : * doc-build
126
+ - doc-build
100
127
101
- - run : *doc-bundle
102
- - store_artifacts :
103
- path : doc/build/sphinx-gallery-files.tar.gz
128
+ - doc-bundle
104
129
105
130
- store_artifacts :
106
131
path : doc/build/html
@@ -111,18 +136,16 @@ jobs:
111
136
steps :
112
137
- checkout
113
138
114
- - run : * apt-install
115
- - run : * fonts-install
116
- - run : * pip-install
139
+ - apt-install
140
+ - fonts-install
141
+ - pip-install
117
142
118
- - run : * deps-install
119
- - run : * mpl-install
143
+ - deps-install
144
+ - mpl-install
120
145
121
- - run : * doc-build
146
+ - doc-build
122
147
123
- - run : *doc-bundle
124
- - store_artifacts :
125
- path : doc/build/sphinx-gallery-files.tar.gz
148
+ - doc-bundle
126
149
127
150
- store_artifacts :
128
151
path : doc/build/html
@@ -133,18 +156,16 @@ jobs:
133
156
steps :
134
157
- checkout
135
158
136
- - run : * apt-install
137
- - run : * fonts-install
138
- - run : * pip-install
159
+ - apt-install
160
+ - fonts-install
161
+ - pip-install
139
162
140
- - run : * deps-install
141
- - run : * mpl-install
163
+ - deps-install
164
+ - mpl-install
142
165
143
- - run : * doc-build
166
+ - doc-build
144
167
145
- - run : *doc-bundle
146
- - store_artifacts :
147
- path : doc/build/sphinx-gallery-files.tar.gz
168
+ - doc-bundle
148
169
149
170
- store_artifacts :
150
171
path : doc/build/html
0 commit comments