-
Notifications
You must be signed in to change notification settings - Fork 3
68 lines (59 loc) · 1.78 KB
/
ci.yml
File metadata and controls
68 lines (59 loc) · 1.78 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
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
# No permissions are required for this workflow
permissions: {}
jobs:
test:
name: General checks
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Use Node.js 22
uses: actions/setup-node@v6
with:
node-version: 22
- name: Install dependencies
run: npm ci --engine-strict # --engine-strict is used to fail-fast if deps require node versions unsupported by the repo
- name: Perform Prettier check
run: npm run prettier:check
- name: Validate current commit (last commit) with commitlint
if: github.event_name == 'push'
run: npm run lint:commit -- --last --verbose
- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request'
run: npm run lint:commit -- --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
- name: Perform Licenses check
run: npm run check-licenses
- name: Perform dependency check
run: npm run knip
- name: Verify plugin.json copies are in sync
run: |
set -eu
COPIES=(
".github/plugin/plugin.json"
)
failed=0
for root in plugins/*/plugin.json; do
dir=$(dirname "$root")
for rel in "${COPIES[@]}"; do
copy="$dir/$rel"
if [ ! -f "$copy" ]; then
echo "::error file=$copy::missing copy of $root"
failed=1
continue
fi
if ! diff -u "$root" "$copy"; then
echo "::error file=$copy::differs from $root"
failed=1
fi
done
done
exit $failed