Merge pull request #140 from runcycles/dependabot/github_actions/acti… #347
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v6 | |
| with: | |
| node-version: "20" | |
| cache: "npm" | |
| - name: Setup Python | |
| uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # 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 6 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 | |
| # Step 5: Composition-index sync check. | |
| # Version pins must match each source spec's info.version, and the | |
| # canonical publication summary must enumerate every indexed document. | |
| - name: Verify composition index matches source specs | |
| run: make spec-index-check |