-
Notifications
You must be signed in to change notification settings - Fork 16
85 lines (83 loc) · 2.24 KB
/
code-health-tools.yml
File metadata and controls
85 lines (83 loc) · 2.24 KB
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
name: 'Code Health Tools'
on:
push:
branches:
- main
paths:
- 'tools/postman/**'
- 'tools/spectral/**'
- 'package.json'
- 'tools/spectral/ipa/package.json'
- '.github/workflows/**'
pull_request:
branches:
- main
paths:
- 'tools/postman/**'
- 'tools/spectral/**'
- 'package.json'
- 'tools/spectral/ipa/package.json'
- '.github/workflows/**'
workflow_dispatch: {}
workflow_call: {}
permissions:
contents: read
jobs:
js-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
sparse-checkout: |
.github
tools/spectral/ipa
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: '20.x'
cache: 'npm'
- name: Install npm dependencies
run: npm ci
- name: Run Jest tests
run: |
npm run test
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
sparse-checkout: |
.github
tools
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: '20.x'
cache: 'npm'
- name: Install npm dependencies
run: npm ci
- name: Run Prettier
run: |
npm run format-check
- name: Run ESLint on JS files
run: |
npm run lint-js
- name: Check IPA docs up-to-date
run: |
npm run gen-ipa-docs
if [[ -n $(git status --porcelain) ]]; then
echo "IPA docs or NPM dependencies not up to date, please run 'npm run gen-ipa-docs' and 'npm install' then commit the changes"
exit 1
fi
exit 0
- name: Download actionlint
id: get_actionlint
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
shell: bash
- name: Check workflow files
run: |
echo "::add-matcher::.github/actionlint-matcher.json"
${{ steps.get_actionlint.outputs.executable }} -color
shell: bash