Repository navigation
ci(deps): bump github/gh-aw-actions/setup-cli from 0.86.2 to 0.87.2 #1217
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: Continuous Integration | |
| permissions: | |
| contents: read | |
| # Deliberately not path-filtered. `CI Gate` is a required status check, and a required | |
| # check that never reports stays *pending* rather than failing - so a docs-only pull | |
| # request would be unmergeable without an admin bypass. | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| workflow_dispatch: | |
| concurrency: | |
| # Keyed on the pull request rather than the ref, and only superseding in-flight runs | |
| # for `pull_request`: cancelling on `push` would abandon CI for a commit already on main. | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| jobs: | |
| build: | |
| timeout-minutes: 15 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [macos-latest, ubuntu-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 | |
| with: | |
| persist-credentials: false | |
| - name: Install Node.js | |
| uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 | |
| with: | |
| node-version: 22.x | |
| cache: 'npm' | |
| - run: npm ci | |
| - name: Cache VS Code test binary | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: .vscode-test | |
| key: vscode-test-${{ runner.os }}-${{ hashFiles('.vscode-test.mjs') }} | |
| restore-keys: | | |
| vscode-test-${{ runner.os }}- | |
| - run: xvfb-run -a npm run test:coverage | |
| if: runner.os == 'Linux' | |
| # On non-Linux, run unit tests directly (test:unit already compiles) | |
| # and skip lint (OS-agnostic; already run on Linux via test:coverage). | |
| - run: npm run test:unit | |
| if: runner.os != 'Linux' | |
| - run: npm run test:vscode | |
| if: runner.os != 'Linux' | |
| - name: Upload coverage to Codecov | |
| if: runner.os == 'Linux' | |
| uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 | |
| with: | |
| directory: ./coverage | |
| fail_ci_if_error: false | |
| verbose: true | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| ci-gate: | |
| name: CI Gate | |
| # `always()` is load-bearing. Without it the job inherits the implicit `success()` | |
| # condition and is reported as *skipped* when a dependency fails - and branch | |
| # protection treats a skipped check as satisfied, letting through exactly the pull | |
| # requests this job exists to stop. | |
| if: always() | |
| needs: [build] | |
| permissions: | |
| contents: read | |
| # `ubuntu-slim` ships jq and bash, which is everything this job needs. | |
| runs-on: ubuntu-slim | |
| timeout-minutes: 5 | |
| steps: | |
| - name: Check that every gated job succeeded | |
| env: | |
| NEEDS_JSON: ${{ toJSON(needs) }} | |
| # Comma-separated jobs allowed to report `skipped`. Empty on purpose: nothing | |
| # here is skipped by design, so an accidental `if:` cannot quietly stop gating | |
| # a job. | |
| ALLOWED_SKIPS: "" | |
| run: | | |
| # Fail closed explicitly rather than relying on the runner's default | |
| # `bash -e`: a `shell:` override would otherwise let a jq error through | |
| # as an empty `failing` and pass the gate. | |
| set -euo pipefail | |
| { | |
| echo "### CI Gate" | |
| echo "" | |
| echo "| Job | Result |" | |
| echo "| --- | --- |" | |
| echo "$NEEDS_JSON" | jq -r 'to_entries[] | "| \(.key) | \(.value.result) |"' | |
| } >> "$GITHUB_STEP_SUMMARY" | |
| failing=$(echo "$NEEDS_JSON" | jq -r --arg allowed "$ALLOWED_SKIPS" ' | |
| ($allowed | split(",") | map(gsub("^\\s+|\\s+$"; "")) | map(select(length > 0))) as $ok | |
| | to_entries[] | |
| | select(.value.result != "success") | |
| | select(.value.result != "skipped" or ([.key] - $ok | length) > 0) | |
| | "\(.key): \(.value.result)" | |
| ') | |
| if [ -n "$failing" ]; then | |
| echo "::error::One or more gated jobs did not succeed:" | |
| echo "$failing" | |
| exit 1 | |
| fi | |
| echo "All gated jobs succeeded or were intentionally skipped." |