Skip to content

Commit 077223e

Browse files
authored
Merge branch 'master' into enh/metadata_statement
2 parents 679b8e0 + ea02934 commit 077223e

File tree

186 files changed

+24501
-4482
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

186 files changed

+24501
-4482
lines changed

.circleci/config.yml

Lines changed: 83 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -2,63 +2,90 @@ version: 2
22
jobs:
33
build_docs:
44
docker:
5-
- image: circleci/python:3.8
5+
- image: cimg/python:3.8
66
steps:
7+
# checkout code to default ~/project
78
- checkout
89
- run:
910
name: install dependencies
1011
command: |
12+
python -m venv env
13+
source env/bin/activate
1114
python -m pip install --upgrade pip
1215
pip install -r requirements.txt
16+
pip install -e ~/project/tools/schemacode/
1317
- run:
1418
name: generate docs
15-
command: mkdocs build --clean --strict --verbose
19+
command: |
20+
source env/bin/activate
21+
mkdocs build --clean --strict --verbose
1622
- persist_to_workspace:
17-
root: .
23+
# the mkdocs build outputs are in ~/project/site
24+
root: ~/project
1825
paths: site
26+
- store_artifacts:
27+
path: ~/project/site/
28+
destination: dev_docs
1929

2030
linkchecker:
2131
docker:
22-
- image: yarikoptic/linkchecker:9.4.0.anchorfix1-1
32+
- image: cimg/python:3.8
2333
steps:
34+
# checkout code to default ~/project
35+
- checkout
2436
- attach_workspace:
25-
at: ~/build
37+
# mkdocs build outputs will be in ~/project/site
38+
at: ~/project
39+
- run:
40+
name: install linkchecker
41+
command: |
42+
python -m venv env
43+
source env/bin/activate
44+
python -m pip install --upgrade pip
45+
python -m pip install linkchecker
2646
- run:
2747
name: check links
2848
command: |
29-
if (! git log -1 --pretty=%b | grep REL:) ; then
30-
chmod a+rX -R ~
31-
linkchecker -t 1 ~/build/site/
32-
# check external separately by pointing to all *html so no
33-
# failures for local file:/// -- yoh found no better way,
34-
linkchecker -t 1 --check-extern \
35-
--ignore-url 'file:///.*' \
36-
--ignore-url https://fonts.gstatic.com \
37-
--ignore-url "https://github.com/bids-standard/bids-specification/(pull|tree)/.*" \
38-
--ignore-url "https://github.com/[^/]*" \
39-
~/build/site/*html ~/build/site/*/*.html
49+
source env/bin/activate
50+
git status
51+
if (! git log -1 --pretty=oneline | grep REL:) ; then
52+
chmod a+rX -R ~
53+
linkchecker -t 1 ~/project/site/
54+
# check external separately by pointing to all *html so no
55+
# failures for local file:/// -- yoh found no better way,
56+
linkchecker -t 1 --check-extern \
57+
--ignore-url 'file:///.*' \
58+
--ignore-url 'https://fonts.gstatic.com' \
59+
--ignore-url 'https://github.com/bids-standard/bids-specification/(pull|tree)/.*' \
60+
--ignore-url 'https://github.com/[^/]*' \
61+
--ignore-url 'https://doi.org/.*' \
62+
--ignore-url 'https://bids-specification.readthedocs.io/en/stable/.*' \
63+
~/project/site/*html ~/project/site/*/*.html
4064
else
41-
echo "Release PR - do nothing"
65+
echo "Release PR - do nothing"
4266
fi
4367
4468
build_docs_pdf:
45-
working_directory: ~/bids-specification/pdf_build_src
4669
docker:
4770
- image: danteev/texlive:latest
4871
steps:
49-
- checkout:
50-
path: ~/bids-specification
72+
# checkout code to default ~/project
73+
- checkout
5174
- run:
5275
name: install dependencies
5376
command: |
54-
python -m pip install --upgrade pip
55-
pip install -r ../requirements.txt
77+
apt-get update && apt install -y python3-pip
78+
python3 -m pip install --upgrade pip
79+
python3 -m pip install -r ~/project/requirements.txt
5680
- run:
5781
name: install font that works with unicode emojis
5882
command: apt-get update && apt-get install -y fonts-symbola
5983
- run:
6084
name: generate pdf version docs
61-
command: bash build_pdf.sh
85+
command: |
86+
cd ~/project/pdf_build_src
87+
bash build_pdf.sh
88+
mv ~/project/pdf_build_src/bids-spec.pdf ~/project/bids-spec.pdf
6289
- store_artifacts:
6390
path: bids-spec.pdf
6491

@@ -69,84 +96,94 @@ jobs:
6996
steps:
7097
- setup_remote_docker:
7198
version: 18.06.0-ce
99+
# checkout code to default ~/project
72100
- checkout
73101
- run:
74102
name: Build changelog
75-
working_directory: ~/build
103+
# $CHANGE_TOKEN is generated via the GitHub web UI, and then securely stored within CircleCI web UI
76104
command: |
105+
mkdir ~/changelog_build
106+
git status
77107
if (git log -1 --pretty=%s | grep Merge*) && (! git log -1 --pretty=%b | grep REL:) ; then
78108
github_changelog_generator \
79109
--user bids-standard \
80110
--project bids-specification \
81111
--token ${CHANGE_TOKEN} \
82-
--output ~/build/CHANGES.md \
83-
--base ~/build/src/pregh-changes.md \
112+
--output ~/changelog_build/CHANGES.md \
113+
--base ~/project/src/pregh-changes.md \
84114
--header-label "# Changelog" \
85115
--no-issues \
86116
--no-issues-wo-labels \
87117
--no-filter-by-milestone \
88118
--no-compare-link \
89119
--pr-label "" \
90120
--release-branch master
91-
cat ~/build/CHANGES.md
92-
mv ~/build/CHANGES.md ~/build/src/CHANGES.md
121+
cat ~/changelog_build/CHANGES.md
93122
else
94123
echo "Commit or Release, do nothing"
95124
fi
96125
- persist_to_workspace:
97-
root: .
98-
paths: src
126+
# raw generated changelog in ~/changelog_build/CHANGES.md
127+
root: ~/.
128+
paths: changelog_build
99129

100130
# Run remark on the auto generated changes.md file
101131
remark:
102132
docker:
103-
- image: node:latest
133+
- image: cimg/node:lts
104134
steps:
135+
# checkout code to default ~/project
105136
- checkout
106137
- attach_workspace:
107-
at: ~/build
138+
# the freshly built CHANGES.md will be in ~/changelog_build/CHANGES.md
139+
at: ~/.
108140
- run:
109141
name: install remark and extensions
110142
command: npm install `cat npm-requirements.txt`
111143
- run:
112144
name: remark on autogenerated CHANGES.md
145+
# format changelog, then use sed to change * to -, then lint changelog
113146
command: |
114-
mkdir ~/project/src/tmp
147+
git status
115148
if (git log -1 --pretty=%s | grep Merge*) && (! git log -1 --pretty=%b | grep REL:) ; then
116-
cat ~/build/src/CHANGES.md
117-
cp ~/build/src/CHANGES.md ~/project/src/tmp/CHANGES.md
118-
npx remark ~/project/src/tmp/CHANGES.md --frail --rc-path .remarkrc
149+
head -n 100 ~/changelog_build/CHANGES.md
150+
npx remark-cli ~/changelog_build/CHANGES.md --rc-path ~/project/.remarkrc --output ~/changelog_build/CHANGES.md
151+
head -n 100 ~/changelog_build/CHANGES.md
152+
sed -i 's/* /- /' ~/changelog_build/CHANGES.md
153+
head -n 100 ~/changelog_build/CHANGES.md
154+
npx remark-cli ~/changelog_build/CHANGES.md --frail --rc-path ~/project/.remarkrc
119155
else
120156
echo "Commit or Release, do nothing"
121-
touch ~/project/src/tmp/empty.txt
122157
fi
123158
- persist_to_workspace:
124-
root: ~/project/src
125-
paths: tmp
159+
# fixed+linted changelog in ~/changelog_build/CHANGES.md
160+
root: ~/.
161+
paths: changelog_build
126162

127163
# Push built changelog to repo
128164
Changelog-bot:
129-
working_directory: ~/build
130165
docker:
131-
- image: circleci/openjdk:8-jdk
166+
- image: cimg/base:stable
132167
steps:
133168
- setup_remote_docker:
134169
version: 17.11.0-ce
170+
# checkout code to default ~/project
135171
- checkout
136172
- attach_workspace:
137-
at: ~/build
173+
# fixed+linted changelog in ~/changelog_build/CHANGES.md
174+
at: ~/.
138175
- deploy:
139176
name: Changelog deployment
140-
working_directory: ~/build
177+
# $CHANGE_TOKEN is generated via the GitHub web UI, and then securely stored within CircleCI web UI
141178
command: |
142179
if (git log -1 --pretty=%s | grep Merge*) && (! git log -1 --pretty=%b | grep REL:) ; then
143-
mv ~/build/tmp/CHANGES.md ~/build/src/CHANGES.md
180+
mv ~/changelog_build/CHANGES.md ~/project/src/CHANGES.md
144181
merge_message=$(git log -1 | grep Merge | grep "pull")
145182
PR_number=$(echo $merge_message | cut -d ' ' -f 4)
146183
git config credential.helper 'cache --timeout=120'
147184
git config user.email "[email protected]"
148185
git config user.name "bids-maintenance"
149-
git add ~/build/src/CHANGES.md
186+
git add ~/project/src/CHANGES.md
150187
git commit -m "[DOC] Auto-generate changelog entry for PR ${PR_number}"
151188
git push https://${CHANGE_TOKEN}@github.com/bids-standard/bids-specification.git master
152189
else
@@ -177,12 +214,4 @@ workflows:
177214
filters:
178215
branches:
179216
only: master
180-
# Ensure that build_docs_pdf always runs last, so that we can use the CircleCI API link for the "latest" artifact
181-
# https://circleci.com/api/v1.1/project/github/bids-standard/bids-specification/latest/artifacts/0/bids-spec.pdf?branch=master
182-
- build_docs_pdf:
183-
requires:
184-
- build_docs
185-
- linkchecker
186-
- github-changelog-generator
187-
- remark
188-
- Changelog-bot
217+
- build_docs_pdf

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
* text=auto
2+
*.png -text
3+
*.jpg -text
4+
*.webm -text
5+
tools/schemacode/schemacode/_version.py export-subst

.github/workflows/codespell.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Codespell
3+
4+
on:
5+
push:
6+
branches: [master]
7+
pull_request:
8+
branches: [master]
9+
10+
jobs:
11+
codespell:
12+
name: Check for spelling errors
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
- uses: codespell-project/actions-codespell@master
18+
with:
19+
skip: js,*.svg
20+
ignore_words_list: fo,te,als

.github/workflows/markdown_style.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
markdown-style:
77
runs-on : ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2
9+
- uses: actions/checkout@v3
1010
- name: Setup NodeJS
1111
uses: actions/setup-node@v2
1212
with:

.github/workflows/no-bad-latin.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# This action initially adopted from The Turing Way from in October 2020.
33
# doi:10.5281/zenodo.3233853
44
# https://github.com/alan-turing-institute/the-turing-way/blob/af98c94/.github/workflows/no-bad-latin.yml
5-
#
5+
#
66
# This action triggers the script tools/no-bad-latin.py to and will throw an error if any latin expression (like e.g. or i.e.) is detected:
7-
#
7+
#
88
# This action will be triggered
99
# - on a push to master
1010
# - on a PR to the master branch and will only check files that were modified in src
@@ -31,10 +31,10 @@ jobs:
3131
# This section collects together the steps involved in running the test
3232
steps:
3333
# Checkout the repository. Relies on another GH-Action.
34-
- uses: actions/checkout@v2
34+
- uses: actions/checkout@v3
3535
# Set up the Python version. Relies on another GH-Action.
3636
- name: Setup Python 3.7
37-
uses: actions/setup-python@v1
37+
uses: actions/setup-python@v3
3838
with:
3939
python-version: 3.7
4040
# Install Python dependencies

.github/workflows/main.yml renamed to .github/workflows/redirect_circleci_artifacts.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ jobs:
1010
repo-token: ${{ secrets.GITHUB_TOKEN }}
1111
artifact-path: 0/bids-spec.pdf
1212
circleci-jobs: build_docs_pdf
13+
job-title: Check the rendered PDF version here!

0 commit comments

Comments
 (0)