forked from ppy/osu-wiki
-
Notifications
You must be signed in to change notification settings - Fork 8
/
run-ci.sh
executable file
·33 lines (24 loc) · 1.13 KB
/
run-ci.sh
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
#!/bin/bash
# This runs CI checks for committed and unstaged files, but not untracked files.
# For newly added files, stage or commit them before running these checks.
CURRENT_BRANCH=$( git branch --show-current )
if test ${CURRENT_BRANCH} = 'master'; then
printf -- "Please run this from a feature branch, i.e. not 'master'.\n"
exit 1
fi
python="python3"
if test -x "./.venv/bin/python3"; then
python="./.venv/bin/python3"
fi
FIRST_COMMIT_HASH=$( git log master..${CURRENT_BRANCH} --pretty=format:%H | tail -1 )
ARTICLES=$( git diff --diff-filter=d --name-only ${FIRST_COMMIT_HASH}^ "wiki/**/*.md" "news/*.md" )
printf -- "--- Binary file size check ---\n\n"
bash scripts/ci/inspect_binary_file_sizes.sh ${FIRST_COMMIT_HASH}
printf -- "\n--- Run remark ---\n\n"
bash scripts/ci/run_remark.sh ${FIRST_COMMIT_HASH}
printf -- "\n--- Run yamllint ---\n\n"
"$python" scripts/ci/run_yamllint.py --config .yamllint.yaml
printf -- "\n--- Broken wikilink check ---\n\n"
osu-wiki-tools check-links --target ${ARTICLES}
printf -- "\n--- Outdated tag check ---\n\n"
osu-wiki-tools check-outdated-articles --workflow --base-commit ${FIRST_COMMIT_HASH}