-
Notifications
You must be signed in to change notification settings - Fork 2
41 lines (32 loc) · 1.06 KB
/
static-checks.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
name: Static Analysis (Linting...)
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
check:
name: JavaScript and Styles
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set Node.js 16.x
uses: actions/[email protected]
with:
node-version: 16.x
- name: Npm install
run: npm ci
- name: Format Code
run: npm run format
- name: Compare the expected and actual content after formatting files
run: |
if [ "$(git diff | wc -l)" -gt "0" ]; then
echo "Detected changes after formatting files. Please format code with Prettier. See changed files below:"
git diff --name-only
exit 1
fi
- name: Lint JavaScript
run: npm run lint
- name: Type checking
run: npm run tsc