chore: version packages #1200
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: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| classify: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| full-suite: ${{ steps.check.outputs.full-suite }} | |
| steps: | |
| - id: check | |
| env: | |
| EVENT_NAME: ${{ github.event_name }} | |
| HEAD_REF: ${{ github.head_ref }} | |
| run: | | |
| if [[ "$EVENT_NAME" == "push" ]] || \ | |
| [[ "$HEAD_REF" == changeset-release/* ]]; then | |
| echo "full-suite=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "full-suite=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| build-and-test-ubuntu: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| fetch-depth: 2 | |
| - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4 | |
| - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm build | |
| - run: pnpm format:check | |
| - run: pnpm test | |
| build-and-test-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| fetch-depth: 2 | |
| - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4 | |
| - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm build | |
| - run: pnpm format:check | |
| - run: pnpm test | |
| build-and-test-full: | |
| needs: classify | |
| if: needs.classify.outputs.full-suite == 'true' | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| node-version: [20, 22] | |
| exclude: | |
| # These are already covered by the light jobs | |
| - os: ubuntu-latest | |
| node-version: 22 | |
| - os: windows-latest | |
| node-version: 22 | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| fetch-depth: 2 | |
| - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4 | |
| - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm build | |
| - run: pnpm format:check | |
| - run: pnpm test | |
| coverage: | |
| needs: classify | |
| if: needs.classify.outputs.full-suite == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4 | |
| - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm build | |
| # Exclude server-git: its V8 coverage provider crashes with forked | |
| # pool (ENOENT on coverage temp files). Tests still run in build-and-test. | |
| - run: pnpm turbo run test --filter='!@paretools/git' --continue -- --coverage | |
| - uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: false | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4 | |
| - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm lint | |
| smoke: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4 | |
| - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm build | |
| - run: pnpm smoke | |
| audit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4 | |
| - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm audit --audit-level=high | |
| ci-gate: | |
| # Always run, even if upstream jobs are skipped | |
| if: always() | |
| needs: | |
| - build-and-test-ubuntu | |
| - build-and-test-windows | |
| - build-and-test-full | |
| - coverage | |
| - lint | |
| - smoke | |
| - audit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check required jobs | |
| run: | | |
| echo "Checking required jobs..." | |
| if [[ "${{ needs.lint.result }}" != "success" ]]; then | |
| echo "lint failed: ${{ needs.lint.result }}" | |
| exit 1 | |
| fi | |
| if [[ "${{ needs.smoke.result }}" != "success" ]]; then | |
| echo "smoke failed: ${{ needs.smoke.result }}" | |
| exit 1 | |
| fi | |
| if [[ "${{ needs.build-and-test-ubuntu.result }}" != "success" ]]; then | |
| echo "build-and-test-ubuntu failed: ${{ needs.build-and-test-ubuntu.result }}" | |
| exit 1 | |
| fi | |
| if [[ "${{ needs.build-and-test-windows.result }}" != "success" ]]; then | |
| echo "build-and-test-windows failed: ${{ needs.build-and-test-windows.result }}" | |
| exit 1 | |
| fi | |
| # Advisory: audit is informational — npm registry outages (HTTP 500) must not block PRs | |
| if [[ "${{ needs.audit.result }}" == "failure" ]]; then | |
| echo "⚠ audit failed (advisory, non-blocking): ${{ needs.audit.result }}" | |
| fi | |
| # Conditional jobs: must pass if they ran, OK to skip | |
| for result in "${{ needs.build-and-test-full.result }}" "${{ needs.coverage.result }}"; do | |
| if [[ "$result" != "success" && "$result" != "skipped" && "$result" != "cancelled" ]]; then | |
| echo "Conditional job failed: $result" | |
| exit 1 | |
| fi | |
| if [[ "$result" == "cancelled" ]]; then | |
| echo "⚠ Conditional job was cancelled (non-blocking)" | |
| fi | |
| done | |
| echo "All required checks passed!" |