-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (48 loc) · 1.46 KB
/
CI-ACC&JSSchema-develop.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
name: Automatic Code Checker & JSON Schema Validation at develop branch
on:
pull_request:
branches:
- develop
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm install --force
- name: Run npm audit and show vulnerabilities
run: npm audit --audit-level=high || exit 0 # Continue even if npm audit fails
- name: Run ESLint
run: npx eslint .
validate-json:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install AJV globally
run: npm install -g ajv-cli
- name: Validate JSON schema
run: ajv validate -s schema.json -d data.json