forked from matplotlib/matplotlib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.yml
More file actions
195 lines (172 loc) · 5.59 KB
/
Copy pathconfig.yml
File metadata and controls
195 lines (172 loc) · 5.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# Circle CI configuration file
# https://circleci.com/docs/
version: 2.1
#######################################
# Define some common steps as commands.
#
commands:
check-skip:
steps:
- run:
name: Check-skip
command: |
export git_log=$(git log --max-count=1 --pretty=format:"%B" | tr "\n" " ")
echo "Got commit message:"
echo "${git_log}"
if [[ -v CIRCLE_PULL_REQUEST ]] && ([[ "$git_log" == *"[skip circle]"* ]] || [[ "$git_log" == *"[circle skip]"* ]]); then
echo "Skip detected, exiting job ${CIRCLE_JOB} for PR ${CIRCLE_PULL_REQUEST}."
circleci-agent step halt;
fi
merge:
steps:
- run:
name: Merge with upstream
command: |
if ! git remote -v | grep upstream; then
git remote add upstream git://github.com/matplotlib/matplotlib.git
fi
git fetch upstream
if [[ "$CIRCLE_BRANCH" != "master" ]] && \
[[ "$CIRCLE_PR_NUMBER" != "" ]]; then
echo "Merging ${CIRCLE_PR_NUMBER}"
git pull --ff-only upstream "refs/pull/${CIRCLE_PR_NUMBER}/merge"
fi
apt-install:
steps:
- run:
name: Install apt packages
command: |
sudo apt -qq update
sudo apt install -y \
inkscape \
ffmpeg \
dvipng \
lmodern \
cm-super \
texlive-latex-base \
texlive-latex-extra \
texlive-fonts-recommended \
texlive-latex-recommended \
texlive-pictures \
texlive-xetex \
graphviz \
fonts-crosextra-carlito \
fonts-freefont-otf \
fonts-humor-sans \
fonts-noto-cjk \
optipng
fonts-install:
steps:
- restore_cache:
key: fonts-2
- run:
name: Install custom fonts
command: |
mkdir -p ~/.local/share/fonts
wget -nc https://github.com/google/fonts/blob/master/ofl/felipa/Felipa-Regular.ttf?raw=true -O ~/.local/share/fonts/Felipa-Regular.ttf || true
fc-cache -f -v
- save_cache:
key: fonts-2
paths:
- ~/.local/share/fonts/
pip-install:
description: Upgrade pip and setuptools and wheel to get as clean an install as possible
steps:
- run:
name: Upgrade pip, setuptools, wheel
command: |
python -m pip install --upgrade --user pip
python -m pip install --upgrade --user wheel
python -m pip install --upgrade --user setuptools
deps-install:
parameters:
numpy_version:
type: string
default: ""
steps:
- run:
name: Install Python dependencies
command: |
python -m pip install --user \
numpy<< parameters.numpy_version >> codecov coverage \
-r requirements/doc/doc-requirements.txt
mpl-install:
steps:
- run:
name: Install Matplotlib
command: python -m pip install --user -ve .
- save_cache:
key: build-deps-1
paths:
# FreeType 2.6.1 tarball.
- ~/.cache/matplotlib/0a3c7dfbda6da1e8fce29232e8e96d987ababbbf71ebc8c75659e4132c367014
# Qhull 2020.2 tarball.
- ~/.cache/matplotlib/b5c2d7eb833278881b952c8a52d20179eab87766b00b865000469a45c1838b7e
doc-build:
steps:
- restore_cache:
keys:
- sphinx-env-v1-{{ .BuildNum }}-{{ .Environment.CIRCLE_JOB }}
- sphinx-env-v1-{{ .Environment.CIRCLE_PREVIOUS_BUILD_NUM }}-{{ .Environment.CIRCLE_JOB }}
- run:
name: Build documentation
command: |
# Set epoch to date of latest tag.
export SOURCE_DATE_EPOCH="$(git log -1 --format=%at $(git describe --abbrev=0))"
# Set release mode only when deploying to devdocs.
if [ "$CIRCLE_PROJECT_USERNAME" = "matplotlib" ] && \
[ "$CIRCLE_BRANCH" = "master" ] && \
[ "$CIRCLE_PR_NUMBER" = "" ]; then
export RELEASE_TAG='-t release'
fi
make html O="-T $RELEASE_TAG"
rm -r build/html/_sources
working_directory: doc
- save_cache:
key: sphinx-env-v1-{{ .BuildNum }}-{{ .Environment.CIRCLE_JOB }}
paths:
- doc/build/doctrees
doc-bundle:
steps:
- run:
name: Bundle sphinx-gallery documentation artifacts
command: tar cf doc/build/sphinx-gallery-files.tar.gz doc/api/_as_gen doc/gallery doc/tutorials
when: always
- store_artifacts:
path: doc/build/sphinx-gallery-files.tar.gz
##########################################
# Here is where the real jobs are defined.
#
jobs:
docs-python38:
docker:
- image: cimg/python:3.8
steps:
- checkout
- check-skip
- merge
- apt-install
- fonts-install
- pip-install
- deps-install
- mpl-install
- doc-build
- doc-bundle
- store_artifacts:
path: doc/build/html
- store_test_results:
path: doc/build/test-results
- add_ssh_keys:
fingerprints:
- "6b:83:76:a5:7d:bd:ce:19:a4:e3:81:e0:80:16:a4:fe"
- deploy:
name: "Deploy new docs"
command: ./.circleci/deploy-docs.sh
#########################################
# Defining workflows gets us parallelism.
#
workflows:
version: 2
build:
jobs:
- docs-python38