forked from ppy/osu-wiki
-
Notifications
You must be signed in to change notification settings - Fork 8
76 lines (64 loc) · 2.46 KB
/
continuous-integration.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
name: osu-wiki continuous integration
on:
pull_request:
branches:
- master
types:
- opened
- reopened
- synchronize
- edited
jobs:
ci:
name: changed files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: inspect binary file sizes
shell: bash
run: bash scripts/ci/inspect_binary_file_sizes.sh ${{ github.sha }} ${{ github.sha }}
- name: set up Node.js
uses: actions/setup-node@v3
with:
cache: npm
node-version: 16
- name: install remark
run: npm ci
- name: run remark on changed files
run: bash scripts/ci/run_remark.sh ${{ github.sha }}
- name: set up Python
uses: actions/setup-python@v4
with:
cache: pip
cache-dependency-path: scripts/requirements.txt
python-version: 3.x
- name: set up CI dependencies
run: pip install -r scripts/requirements.txt
- name: run yamllint on .yaml and .md files
run: |
python scripts/ci/run_yamllint.py --config .yamllint.yaml
- name: find broken wikilinks
shell: bash
env:
PULL_REQUEST_TAG: 'SKIP_WIKILINK_CHECK'
run: |
if ${{ contains(github.event.pull_request.body, env.PULL_REQUEST_TAG) }}; then
echo "::notice::Broken wikilink check suppressed ($PULL_REQUEST_TAG tag found in the pull request)"
exit 0
fi
ARTICLES=$( git diff --diff-filter=d --name-only ${{ github.sha }}^ ${{ github.sha }} "wiki/**/*.md" "news/*.md" )
osu-wiki-tools check-links --target $ARTICLES
- name: check if translations are marked as outdated
shell: bash
env:
PULL_REQUEST_TAG: 'SKIP_OUTDATED_CHECK'
run: |
if ${{ contains(github.event.pull_request.body, env.PULL_REQUEST_TAG) }}; then
echo "::notice::Outdated articles check suppressed ($PULL_REQUEST_TAG tag found in the pull request)"
exit 0
fi
# get the first commit of the branch associated with the PR; GitHub's ubuntu-latest has curl/jq: https://github.com/actions/virtual-environments
FIRST_PR_COMMIT_HASH=$( curl -sS ${{ github.event.pull_request.commits_url }}?per_page=1 | jq -r '.[0].sha' || true )
osu-wiki-tools check-outdated-articles --workflow --base-commit ${{ github.sha }} --outdated-since $FIRST_PR_COMMIT_HASH