-
Notifications
You must be signed in to change notification settings - Fork 35
64 lines (54 loc) · 1.68 KB
/
pr-checks.yaml
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
name: generated
on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- main
jobs:
# This job ensures that any PR targeting the main branch has up-to-date generated JSON files.
# It runs the parser and checks for changes in git tracked files.
# If any changes are detected, the job fails
json-synchronized:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Generate JSON files
run: make parse
- name: Check for JSON file changes
run: |
if [[ $(git diff --name-only) ]]
then
echo "JSON files out of date. Looks like you might need to run the specification parser."
false
else
echo "JSON files up to date. Looks good!"
fi
# Lint JSON files. Ensures statements contain normative keywords from RFC 2119.
json-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Lint
run: make lint
# Ensure all tables of contents are up to date.
markdown-toc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/setup-node@v4
with:
node-version: "18"
- name: Generate ToC
run: make markdown-toc
- name: Check for file changes
run: |
if [[ $(git diff --name-only) ]]
then
echo "Table of content out of date. Looks like you might need to run make markdown-toc."
false
else
echo "Table of contents up to date. Looks good!"
fi