Skip to content

feat(grokbuild): add usage endpoint support #607

feat(grokbuild): add usage endpoint support

feat(grokbuild): add usage endpoint support #607

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
# Cancel superseded runs on the same ref.
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
console:
name: Console (typecheck · test · build · i18n)
runs-on: ubuntu-latest
defaults:
run:
working-directory: console
steps:
- uses: actions/checkout@v7
- uses: pnpm/action-setup@v6
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
cache-dependency-path: console/pnpm-lock.yaml
- run: pnpm install --frozen-lockfile
- name: Typecheck
run: pnpm typecheck
- name: Unit tests
run: pnpm test
- name: i18n parity
run: pnpm i18n:check
# Builds the SPA and syncs dist/ -> ../assets/console (reads version from
# ../Cargo.toml + git short SHA). assets/console is gitignored, so this only
# validates the build succeeds.
- name: Build
run: pnpm build
docs:
name: Docs (build)
runs-on: ubuntu-latest
defaults:
run:
working-directory: docs
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v6
with:
node-version: 22
cache: npm
cache-dependency-path: docs/package-lock.json
- run: npm ci
- name: Build
run: npm run build
# Restore v1's docs deploy: on push to the default branch, build the docs site
# and publish it to Cloudflare Pages (PRs only build, above). Same secrets +
# wrangler-action as v1's `deploy-docs-cloudflare`.
deploy-docs-cloudflare:
name: Deploy Docs (Cloudflare Pages)
if: ${{ github.event_name == 'push' && github.ref_name == github.event.repository.default_branch }}
runs-on: ubuntu-latest
environment:
name: cloudflare
defaults:
run:
working-directory: docs
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v6
with:
node-version: 22
cache: npm
cache-dependency-path: docs/package-lock.json
- run: npm ci
- name: Build docs
run: npm run build
- name: Deploy docs to Cloudflare Pages
uses: cloudflare/wrangler-action@v4
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_PROJECT_ID: ${{ secrets.CLOUDFLARE_PROJECT_ID }}
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
workingDirectory: "docs"
command: pages deploy ./dist --project-name=${{ secrets.CLOUDFLARE_PROJECT_ID }}
backend:
name: Backend (fmt · clippy · test · edge-wasm)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Rust toolchain (stable + clippy/rustfmt + wasm target)
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
targets: wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2
- name: Format check
run: cargo fmt --all --check
- name: Clippy (deny warnings)
run: cargo clippy --features full --all-targets -- -D warnings
- name: Tests
run: cargo test --features full
# Canonical edge build: lib-only, no default features, edge feature, wasm
# target (the native deps must NOT leak into the worker).
- name: Edge wasm check
run: cargo check --lib --no-default-features --features edge --target wasm32-unknown-unknown