-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (57 loc) · 1.69 KB
/
lint.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
name: Lint
on:
pull_request:
jobs:
file-ref-check:
name: file-ref-check
runs-on: ubuntu-latest
strategy:
matrix:
docs: [mission-control, canary-checker]
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: 'recursive'
- uses: actions/setup-node@v4
with:
node-version: '20.11.1'
- name: Install dependencies and build
run: |
cd ${{ matrix.docs }}
npm ci
npm run build
- name: Check for broken file references
run: |
cd ${{ matrix.docs }}/build
echo "Checking broken files in $(pwd)"
broken_files=$(find . -type f -name "*.html" -exec grep -il "file=../../../modules" {} +)
echo "Broken files: $broken_files"
if [ -n "$broken_files" ]; then
echo "Error: Broken file references found in ${{ matrix.docs }}"
echo "Files with broken references:"
exit 1
else
echo "No broken file references found in ${{ matrix.docs }}"
exit 0
fi
prettier:
name: prettier
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: '20.11.1'
- name: Run format check
run: make fmt-check
continue-on-error: true
id: fmt-check
- name: Run formatter and show diff if check failed
if: steps.fmt-check.outcome == 'failure'
run: |
make fmt
git diff
- name: Exit with error if format check failed
if: steps.fmt-check.outcome == 'failure'
run: exit 1