ci: use cheaper review model and cache pipeline installs
PR Check / Security scan (Snyk) (pull_request) Skipped
PR Check / Lint + typecheck (pull_request) Successful in 1m42s
PR Check / Secret scan (gitleaks) (pull_request) Successful in 6s
PR Check / Dependency audit (pull_request) Successful in 9s
PR Check / Dockerfile lint (droast) (pull_request) Successful in 5s
PR Check / AI code review (opencode) (pull_request) Successful in 45s

- review model: opencode-go/claude-haiku-5-5#medium instead of
  deepseek-v4.1-flash#max; flash has no medium variant
- merge lint and typecheck into one job with a single pnpm install
- cache the pnpm store and opencode binary via actions/cache@v4.1.0,
  keyed on a sha256 of the lockfile (hashFiles is empty on this runner)
- update the decision records and log
This commit is contained in:
Noel Sabia committed 2026-10-20 20:56:52 +02:00
1 parent 71b73aacc8
commit fa8fafb7ef
5 files changed
+110 -44

No files matched your search

+66 -33
View File
@@ -17,9 +17,13 @@ env:
APP_DIR: .
jobs:
# ---------------------------------------------------------------- lint ----
lint:
name: ESLint
# ------------------------------------------------------ lint + typecheck --
# One job, not two: both checks use the same image, the same lockfile and
# the same install, so splitting them doubled the install work (and, on the
# 2 vCPU runner, the CPU contention). They still report as separate steps,
# so a failure says which check failed.
checks:
name: Lint + typecheck
runs-on: ubuntu-latest
container: node:22-bookworm
steps:
@@ -32,6 +36,32 @@ jobs:
# missing or empty")
version: 11
- name: Resolve pnpm store and lockfile hash
id: pnpm
working-directory: ${{ env.APP_DIR }}
run: |
# hashFiles() evaluates empty in this act runner, so the cache key
# is built from a real sha256 in a shell step instead. The store
# directory's own name is the layout version (store/v11 here), so
# it is in the key: a store from another pnpm major is unusable.
store="$(pnpm store path --silent)"
echo "store=$store" >> "$GITHUB_OUTPUT"
echo "layout=$(basename "$store")" >> "$GITHUB_OUTPUT"
echo "lockfile=$(sha256sum pnpm-lock.yaml | cut -d' ' -f1)" >> "$GITHUB_OUTPUT"
- name: Restore pnpm store
# v4.1.x, not v4.2+: the runner's cache server may only speak the v1
# API (Gitea runner 2.x). v4.1 works on both v1-only and v3 runners.
# A cache outage must not turn into a red PR: install still works
# without the store, just slower.
continue-on-error: true
uses: actions/cache@v4.1.0
with:
path: ${{ steps.pnpm.outputs.store }}
key: pnpm-store-${{ runner.os }}-${{ steps.pnpm.outputs.layout }}-${{ steps.pnpm.outputs.lockfile }}
restore-keys: |
pnpm-store-${{ runner.os }}-${{ steps.pnpm.outputs.layout }}-
- name: Install dependencies
working-directory: ${{ env.APP_DIR }}
run: pnpm install --frozen-lockfile
@@ -40,25 +70,6 @@ jobs:
working-directory: ${{ env.APP_DIR }}
run: pnpm lint
# ------------------------------------------------------------ typecheck ---
typecheck:
name: Typecheck
runs-on: ubuntu-latest
container: node:22-bookworm
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
# match the pnpm major version used locally (v11.x) - older pnpm
# rejects our config-only pnpm-workspace.yaml ("packages field
# missing or empty")
version: 11
- name: Install dependencies
working-directory: ${{ env.APP_DIR }}
run: pnpm install --frozen-lockfile
- name: Typecheck (vue-tsc)
working-directory: ${{ env.APP_DIR }}
run: pnpm typecheck
@@ -234,14 +245,33 @@ jobs:
with:
fetch-depth: 0
- name: Restore opencode binary
id: opencode-cache
# The installer writes to $HOME/.opencode/bin. Caching it saves the
# ~4s download+extract per run - small next to the model call, but
# free to keep. Key includes the pinned version, so bumping the
# version below invalidates the cached binary automatically.
# As above, a cache outage falls back to the installer.
continue-on-error: true
uses: actions/cache@v4.1.0
with:
path: ~/.opencode/bin
key: opencode-v2.0.32-${{ runner.os }}
- name: Install opencode CLI
if: steps.opencode-cache.outputs.cache-hit != 'true'
run: curl -fsSL https://opencode.ai/v2/install | bash -s -- -v 2.0.32
# v2 installer is required: the classic /install URL ships only
# OpenCode 1.x (resolved to v1.19.3 on arm64), which cannot resolve
# model variants like "#max" and failed with ProviderModelNotFoundError.
# model variants like "#medium" and failed with ProviderModelNotFoundError.
# Version pinned (-v 2.0.32) so a breaking v2 release cannot fail
# the job mid-PR; bump deliberately, not automatically.
- name: Add opencode to PATH
# The installer appends the directory to $GITHUB_PATH itself, but that
# step is skipped on a cache hit. Add it unconditionally.
run: echo "$HOME/.opencode/bin" >> "$GITHUB_PATH"
- name: Get PR diff
run: |
# lockfile changes bloat the diff (175KB here) and are pointless to
@@ -258,15 +288,18 @@ jobs:
env:
OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}
run: |
# opencode-go/deepseek-v4.1-flash#max: switched from
# deepseek-v4-pro#max on 2026-10-20 after two consecutive runs
# failed with "Upstream request failed: Endpoint is unavailable"
# (~10 min apart; the model is still listed active, the endpoint
# just does not serve). This is the default recorded in
# OKF_Nuxt/open-questions.md for exactly this case. NOTE the
# provider prefix must be "opencode-go", NOT "opencode" (Zen is a
# different, pay-per-call provider and fails with 'Insufficient
# account funds').
# opencode-go/claude-haiku-5-5#medium: cheap ($0.10/$0.50 per M
# tokens) and, unlike deepseek-v4.1-flash, it has a #medium
# reasoning variant - flash only exposes low/high/max, so every
# review there ran at maximum effort. #medium keeps the review
# competent without paying for max reasoning on each push.
# History: deepseek-v4-pro#max -> deepseek-v4.1-flash#max ->
# haiku-5-5#medium (2026-10-20). The pro endpoint failed two
# consecutive runs with "Upstream request failed: Endpoint is
# unavailable" before the flash switch; that fallback is recorded
# in OKF_Nuxt/open-questions.md. NOTE the provider prefix must be
# "opencode-go", NOT "opencode" (Zen is a different, pay-per-call
# provider and fails with 'Insufficient account funds').
#
# Auth is env-only: the CLI picks up OPENCODE_API_KEY from the
# environment (verified headless). Deliberately NO opencode.json:
@@ -300,7 +333,7 @@ jobs:
EXIT_CODE=0
opencode run \
--print-logs \
--model opencode-go/deepseek-v4.1-flash#max \
--model opencode-go/claude-haiku-5-5#medium \
"You are a principal engineer performing a rigorous code review on a
pull request. You have tool access: read repo files for context when
the diff alone is ambiguous, but review ONLY code changed in this PR.