-
Notifications
You must be signed in to change notification settings - Fork 2
61 lines (51 loc) · 2.12 KB
/
validate.yml
File metadata and controls
61 lines (51 loc) · 2.12 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
name: Validate OpenAPI Spec Suite
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
validate:
name: Lint sources, check merge drift, lint merged artifacts
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: "20"
cache: "npm"
- name: Setup Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: "3.12"
- name: Install Node dependencies (spectral)
run: npm ci
- name: Install Python dependencies (PyYAML)
run: pip install PyYAML
# Step 1: Lint all 5 canonical source specs.
# Catches YAML/OpenAPI errors in any source file before merge.
- name: Lint all source specs
run: make lint-sources
# Step 2: Merge drift check.
# Regenerates the pre-built merged artifacts from source specs and fails
# if the result differs from what's committed. This prevents contributors
# from accidentally shipping stale merged files after editing a source spec.
- name: Verify merged artifacts match sources (drift check)
run: make merge-check
# Step 3: Lint the pre-built merged artifacts.
# Catches bugs in the merge script itself — e.g., the merged output might
# have broken $refs, enum duplicates, or missing required fields even if
# every source spec is individually valid.
- name: Lint merged artifacts
run: make lint-merged
# Step 4: Changelog pointer + version sync check.
# Each source spec must declare info.x-changelog pointing at an existing
# markdown file under changelogs/, and that file's most recent heading
# must match the spec's info.version. Catches "bumped the spec but
# forgot to add a changelog entry."
- name: Verify changelog pointers stay in sync with spec versions
run: make changelog-check