-
Notifications
You must be signed in to change notification settings - Fork 14
87 lines (79 loc) · 2.72 KB
/
lint.yaml
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
name: Lint
on:
pull_request
jobs:
schema_validation:
runs-on: ubuntu-latest
steps:
- name: Checkout files
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: Install node modules
run: npm install
- name: Validate changed schema and data files
run: |
TARGET_BRANCH="${{ github.base_ref }}"
CHANGED_FILES=$(git diff --name-only --diff-filter=AMR origin/$TARGET_BRANCH HEAD)
for FILE in $CHANGED_FILES
do
echo "$FILE"
case "$FILE" in
data/json/schemas/common.json)
npx ajv compile --spec=draft2020 -s ${FILE}
;;
data/json/schemas/check.json)
npx ajv compile --spec=draft2020 -s ${FILE} -r data/json/schemas/common.json
;;
data/json/schemas/guideline.json)
npx ajv compile --spec=draft2020 -s ${FILE} -r data/json/schemas/common.json
;;
data/json/schemas/faq.json)
npx ajv compile --spec=draft2020 -s ${FILE} -r data/json/schemas/common.json
;;
data/yaml/gl/*.yaml)
npx ajv validate --spec=draft2020 -s data/json/schemas/guideline.json -r data/json/schemas/common.json -d ${FILE}
;;
data/yaml/checks/*.yaml)
npx ajv validate --spec=draft2020 -s data/json/schemas/check.json -r data/json/schemas/common.json -d ${FILE}
;;
data/yaml/faq/*.yaml)
npx ajv validate --spec=draft2020 -s data/json/schemas/faq.json -r data/json/schemas/common.json -d ${FILE}
;;
esac
done
sphinx_build:
runs-on: ubuntu-latest
steps:
- name: Checkout files
uses: actions/checkout@v3
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9.x'
- name: Install the Latest pip
run: python -m pip install --upgrade pip
- name: install ja_JP.UTF-8 locale
run: |
sudo locale-gen ja_JP.UTF-8
sudo update-locale LANG=ja_JP.UTF-8
- name: Install required modules
run: python -m pip install -r requirements.txt --upgrade
- name: Build HTML
env:
BASE_URL: https://a11y-guidelines.freee.co.jp/
TZ: JST-9
run: make sphinx_options="-W" clean html
- name: Check for unreferenced include files
run: make check-includes
- name: Run sphinx-lint
run: |
sphinx-lint --enable all --disable line-too-long ./ja/source
sphinx-lint --enable all --disable line-too-long ./en/source