fix(auth): unblock [M] manual-fallback API key path + suppress misleading "Claude model unavailable" error #3828
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: 'Build & Test' | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - release/** | |
| pull_request: | |
| jobs: | |
| job_build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@eae0cfeb286e66ffb5155f1a79b90583a127a68b # v2 | |
| with: | |
| version: 10.23.0 | |
| run_install: false | |
| - name: Set up Node | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version-file: 'package.json' | |
| cache: 'pnpm' | |
| # Cache the materialized node_modules tree (incl. pnpm's virtual store | |
| # at node_modules/.pnpm/) on top of the pnpm store cache that | |
| # `cache: 'pnpm'` above already provides. The store cache makes package | |
| # downloads instant; this cache makes the link step a no-op. | |
| # Key includes the runner OS + Node major + pnpm-lock.yaml hash so the | |
| # cache is safe to share with job_lint (same defaults) and warmable by | |
| # job_test on Node 20. | |
| - name: Cache node_modules | |
| id: node-modules-cache | |
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 | |
| with: | |
| path: node_modules | |
| key: node-modules-v2-${{ runner.os }}-node20-${{ hashFiles('pnpm-lock.yaml') }} | |
| - name: Install dependencies with pnpm | |
| if: steps.node-modules-cache.outputs.cache-hit != 'true' | |
| run: pnpm install --frozen-lockfile | |
| - name: Build | |
| run: pnpm build | |
| - name: Pack | |
| run: pnpm pack | |
| - name: Archive Artifacts | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: ${{ github.sha }} | |
| path: | | |
| ${{ github.workspace }}/*.tgz | |
| job_lint: | |
| name: Lint | |
| needs: job_build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@eae0cfeb286e66ffb5155f1a79b90583a127a68b # v2 | |
| with: | |
| version: 10.23.0 | |
| run_install: false | |
| - name: Set up Node | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version-file: 'package.json' | |
| cache: 'pnpm' | |
| # Same key as job_build so this restores from that cache when present. | |
| - name: Cache node_modules | |
| id: node-modules-cache | |
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 | |
| with: | |
| path: node_modules | |
| key: node-modules-v2-${{ runner.os }}-node20-${{ hashFiles('pnpm-lock.yaml') }} | |
| - name: Install dependencies with pnpm | |
| if: steps.node-modules-cache.outputs.cache-hit != 'true' | |
| run: pnpm install --frozen-lockfile | |
| - name: Run Linter | |
| run: pnpm lint | |
| job_test: | |
| name: Node (${{ matrix.node }}) Unit Tests | |
| needs: job_build | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node: [20, 22, 24] | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@eae0cfeb286e66ffb5155f1a79b90583a127a68b # v2 | |
| with: | |
| version: 10.23.0 | |
| run_install: false | |
| - name: Set up Node | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| cache: 'pnpm' | |
| # Per-Node-version cache. The Node 20 entry is shared with job_build / | |
| # job_lint; Node 22 / 24 are populated by the first matrix run on each | |
| # version and then reused across re-runs and PRs with the same | |
| # pnpm-lock.yaml hash. | |
| - name: Cache node_modules | |
| id: node-modules-cache | |
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 | |
| with: | |
| path: node_modules | |
| key: node-modules-v2-${{ runner.os }}-node${{ matrix.node }}-${{ hashFiles('pnpm-lock.yaml') }} | |
| - name: Install dependencies with pnpm | |
| if: steps.node-modules-cache.outputs.cache-hit != 'true' | |
| run: pnpm install --frozen-lockfile | |
| - name: Run Unit Tests | |
| run: pnpm test | |
| - name: Push code coverage to codecov | |
| uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # pin@v5.3.1 | |
| with: | |
| # Need to specify the token here, as the codecov action requires it for protected branches. | |
| # If not set, this error is shown: `Token required because branch is protected` | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| # Do not fail the build if codecov fails to report the coverage. | |
| fail_ci_if_error: false | |
| flags: unit-tests |