-
Notifications
You must be signed in to change notification settings - Fork 1
113 lines (109 loc) · 3.34 KB
/
check_pr.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
name: Check the source code
on:
pull_request:
branches:
- main
jobs:
Prettier:
name: Prettier
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/[email protected]
with:
node-version: '20.3.0'
cache: 'npm'
- run: npm ci
- run: npm run format
ESLint:
name: ESLint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/[email protected]
with:
node-version: '20.3.0'
cache: 'npm'
- run: npm ci
- run: npm run lint
StyleLint:
name: StyleLint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/[email protected]
with:
node-version: '20.3.0'
cache: 'npm'
- run: npm ci
- run: npm run lint:css
RemarkLint:
name: RemarkLint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/[email protected]
with:
node-version: '20.3.0'
cache: 'npm'
- run: npm ci
- run: npm run lint:md
CheckTypo:
name: Check typo
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/[email protected]
with:
node-version: '20.3.0'
cache: 'npm'
- run: npm ci
- run: npm run check:spell
Test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/[email protected]
with:
node-version: '20.3.0'
cache: 'npm'
- run: npm ci
- run: npm run test:ci
CheckLicense:
name: Check license
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: bash add_license_to_files.sh
- run: >-
if [[ $(git diff --name-only HEAD | grep -e src/ || echo '') != "" ]]; then
RED="e[31m"
END_COLOR="e[0m"
echo ""
echo -e "${RED}######################################################################${END_COLOR}"
echo -e "${RED}# Some of the files in the src folder do not have the LICENSE block. #${END_COLOR}"
echo -e "${RED}# Please sh add_license_to_files.sh before committing. #${END_COLOR}"
echo -e "${RED}######################################################################${END_COLOR}"
echo ""
exit 1
fi
checkSchema:
name: Check schema
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci
- run: npx json2ts ./schema/report_data.json > src/@types/report_data.d.ts --style.singleQuote --style.trailingComma=all --no-style.semi
- run: >-
if [[ $(git diff --name-only HEAD | grep 'src/@types/report_data.d.ts' || echo '') != "" ]]; then
RED="\e[31m"
END_COLOR="\e[0m"
echo ""
echo -e "${RED}###########################################################${END_COLOR}"
echo -e "${RED}# The report_data.d.ts of the report page do not match. #${END_COLOR}"
echo -e "${RED}# Please npx json2ts report_data.json before committing. #${END_COLOR}"
echo -e "${RED}###########################################################${END_COLOR}"
echo ""
exit 1
fi