fix: migrate internal schemas package to npm-hosted package #1447
Workflow file for this run
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: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| permissions: {} | |
| concurrency: | |
| group: ${{ github.ref }}-${{ github.workflow }} | |
| cancel-in-progress: true | |
| jobs: | |
| test-node: | |
| name: Test Node.js | |
| permissions: | |
| contents: read | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| node-version: [22.x, 24.x, 25.x] | |
| runs-on: ${{ matrix.os }} | |
| # Per-endpoint Zod schemas (#171) that once bloated .d.ts emit are gone, | |
| # but tsc build still peaks around 3.7 GB locally; keep headroom above | |
| # the 2 GB Node default for slower/smaller CI runners. | |
| env: | |
| NODE_OPTIONS: --max-old-space-size=6144 | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - name: Install | |
| run: npm ci | |
| - name: Run unit tests | |
| run: npm test | |
| shell: bash | |
| license-header: | |
| name: Check SPDX license header | |
| permissions: | |
| contents: read | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6 | |
| - name: Install | |
| run: npm ci | |
| - name: License header check | |
| run: npm run test:spdx | |
| notice-file: | |
| name: Check NOTICE.txt is up to date | |
| permissions: | |
| contents: read | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6 | |
| - name: Install | |
| run: npm ci | |
| - name: Verify NOTICE.txt | |
| run: npm run test:notice | |
| test-bun: | |
| name: Test Bun | |
| permissions: | |
| contents: read | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| # `bun run build` shells out to Node-hosted tsc; same heap constraint as | |
| # the Node job above. | |
| env: | |
| NODE_OPTIONS: --max-old-space-size=6144 | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | |
| with: | |
| persist-credentials: false | |
| - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2 | |
| - name: Install | |
| run: bun install | |
| - name: Build | |
| run: bun run build | |
| - name: Run unit tests | |
| # 30 s per test: Windows runners are slower, and building 500+ Commander | |
| # stubs for the full ES manifest takes longer than bun's 5 s default. | |
| run: bun test --timeout 30000 | |
| validate-pr-title: | |
| if: github.event_name == 'pull_request' | |
| name: Validate PR title | |
| permissions: | |
| pull-requests: read | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: PR Conventional Commit Validation | |
| uses: ytanikin/pr-conventional-commits@639145d78959c53c43112365837e3abd21ed67c1 # v1.5.2 | |
| with: | |
| task_types: '["feat","fix","docs","test","ci","refactor","perf","chore","revert"]' | |
| add_label: "false" | |
| megalinter: | |
| name: MegaLinter | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: MegaLinter | |
| uses: oxsecurity/megalinter/flavors/javascript@ef3e84b8b836d76db562d0f3ed7da61e8fd538bc # v9.6.0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| VALIDATE_ALL_CODEBASE: ${{ github.event_name == 'push' }} | |
| cli-schema: | |
| name: Check CLI schema is up to date | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| runs-on: ubuntu-latest | |
| env: | |
| NODE_OPTIONS: --max-old-space-size=6144 | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6 | |
| with: | |
| node-version: 24.x | |
| - name: Install | |
| run: npm ci | |
| - name: Build | |
| run: npm run build | |
| - name: Regenerate CLI schema | |
| run: npm run build:schema | |
| - name: Check for uncommitted changes | |
| run: | | |
| if ! git diff --exit-code docs/cli/schema.json; then | |
| echo "" | |
| echo "docs/cli/schema.json is out of date. Run 'npm run build:schema' and commit the result." | |
| exit 1 | |
| fi | |
| - name: Comment on PR | |
| if: failure() && github.event_name == 'pull_request' | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| PR_NUMBER: ${{ github.event.pull_request.number }} | |
| run: | | |
| gh pr comment "$PR_NUMBER" --body "<!-- schema-stale --> | |
| \`docs/cli/schema.json\` is out of date. Comment \`/fix-schema\` on this PR and the bot will regenerate and commit it automatically." | |
| ci: | |
| name: CI Result | |
| if: always() | |
| runs-on: ubuntu-latest | |
| needs: | |
| - test-node | |
| - license-header | |
| - test-bun | |
| - validate-pr-title | |
| - megalinter | |
| - cli-schema | |
| steps: | |
| - run: | | |
| if [[ "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}" == "true" ]]; then | |
| echo "One or more required jobs failed or were cancelled." | |
| exit 1 | |
| fi |