-
Notifications
You must be signed in to change notification settings - Fork 83
/
config.yml
170 lines (141 loc) · 4.5 KB
/
config.yml
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
# See: https://circleci.com/blog/deploying-documentation-to-github-pages-with-continuous-integration/
version: 2.1
_check_skip: &check_skip
name: Check-skip
command: |
set -e
export COMMIT_MESSAGE=$(git log --format=oneline -n 1);
if [[ -v CIRCLE_PULL_REQUEST ]] && ([[ "$COMMIT_MESSAGE" == *"[skip circle]"* ]] || [[ "$COMMIT_MESSAGE" == *"[circle skip]"* ]]); then
echo "Skip detected, exiting job ${CIRCLE_JOB} for PR ${CIRCLE_PULL_REQUEST}."
circleci-agent step halt;
fi
jobs:
docs-build:
machine:
image: default
steps:
- checkout
- run:
<<: *check_skip
# restore cache from last build. Unless __init__.py has changed since then
- restore_cache:
keys:
- data-cache-0-{{ checksum "./mne_bids/__init__.py" }}
# Also restore pip cache to speed up installations
- restore_cache:
keys:
- pip-cache-0-{{ checksum "./pyproject.toml" }}
- run:
name: Setup Python3 environment
command: |
python3 -m venv /home/circleci/mne_bids_env
echo "source /home/circleci/mne_bids_env/bin/activate" >> $BASH_ENV
- run:
name: Install Python packages
command: |
python -m pip install --upgrade --progress-bar off pip
python -m pip install --upgrade https://github.com/mne-tools/mne-python/archive/refs/heads/main.zip
python -m pip install -e .[test,doc]
- run:
name: Build the documentation
no_output_timeout: 30m
command: |
make build-doc
- persist_to_workspace:
root: doc/_build
paths: html
- store_artifacts:
path: doc/_build/html/
destination: dev
# Store the data cache
- save_cache:
key: data-cache-0-{{ checksum "./mne_bids/__init__.py" }}
paths:
- ~/mne_data
# Store pip cache
- save_cache:
key: pip-cache-0-{{ checksum "./pyproject.toml" }}
paths:
- ~/.cache/pip
docs-deploy:
# will only be run on main branch
docker:
- image: cimg/node:lts
steps:
- checkout
- attach_workspace:
at: doc/_build
- run:
name: Install and configure dependencies
# do not update gh-pages above 3.0.0
# see: https://github.com/tschaub/gh-pages/issues/354
command: |
npm install gh-pages@3.0.0
git config --global user.email "circle@mne.com"
git config --global user.name "Circle Ci"
- add_ssh_keys:
fingerprints:
- "13:a4:d4:26:26:fe:ea:a8:1a:f4:0b:0e:33:67:74:7d"
- run:
# push built docs into the `dev` directory on the `gh-pages` branch
name: Deploy docs to gh-pages branch
command: node_modules/gh-pages/bin/gh-pages.js --dotfiles --message "doc updates [skip ci]" --dist doc/_build/html --dest ./dev
link-check:
machine:
image: default
steps:
- checkout
- attach_workspace:
at: doc/_build
- restore_cache:
keys:
- pip-cache-0-{{ checksum "./pyproject.toml" }}
- run:
name: Setup Python3 environment
command: |
python3 -m venv /home/circleci/mne_bids_env
echo "source /home/circleci/mne_bids_env/bin/activate" >> $BASH_ENV
- run:
name: Install Python packages
command: |
python -m pip install --upgrade --progress-bar off pip
python -m pip install --upgrade https://github.com/mne-tools/mne-python/archive/refs/heads/main.zip
python -m pip install -e .[test,doc]
- run:
name: Check links
no_output_timeout: 30m
command: |
make -C doc linkcheck
workflows:
commit:
jobs:
- docs-build
- docs-deploy:
requires:
- docs-build
filters:
branches:
only: main
nightly:
jobs:
- docs-build
triggers:
- schedule:
cron: "0 4 * * *"
filters:
branches:
only:
- main
weekly:
jobs:
- docs-build
- link-check:
requires:
- docs-build
triggers:
- schedule:
cron: "0 4 * * 0"
filters:
branches:
only:
- main