Skip to content

fix: a broad round of bug fixes across the site, API, CLI, and translations #341

fix: a broad round of bug fixes across the site, API, CLI, and translations

fix: a broad round of bug fixes across the site, API, CLI, and translations #341

Workflow file for this run

name: cli-ci
on:
pull_request:
paths:
- ".github/workflows/cli-ci.yml"
- "packages/petdex-cli/**"
push:
branches: [main]
paths:
- ".github/workflows/cli-ci.yml"
- "packages/petdex-cli/**"
workflow_dispatch:
permissions:
contents: read
jobs:
package:
name: CLI package (${{ matrix.os }}, Node ${{ matrix.node }})
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node: [20, 22, 24]
defaults:
run:
working-directory: packages/petdex-cli
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Setup Node
uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Build CLI
run: bun run build
- name: Typecheck CLI
run: bun run typecheck
- name: Run CLI tests
if: runner.os != 'Windows'
# `bun run test`, not a bare `bun test`: the suite's 30s per-test
# timeout lives in the package script, and the spawn-a-CLI specs
# brush Bun's 5s default on a loaded runner.
run: bun run test
- name: Skip POSIX-only CLI tests on Windows
if: runner.os == 'Windows'
shell: pwsh
run: |
Write-Host "Skipping the full Bun test suite on Windows because several current CLI tests assert POSIX-only process, shell, path, and chmod behavior."
Write-Host "This Windows job still verifies build, typecheck, npm pack, and npx.cmd execution for the packaged CLI."
- name: Verify built binary
run: |
node dist/petdex.js --version
node scripts/submit-smoke.mjs
- name: Verify npm package contents
run: npm pack --silent
- name: Verify packed CLI via npx
if: runner.os != 'Windows'
shell: bash
run: |
set -euo pipefail
tarball="$(find . -maxdepth 1 -name 'petdex-*.tgz' -print -quit)"
test -n "$tarball"
npx -y --package "$tarball" petdex --version
- name: Verify packed CLI via npx.cmd
if: runner.os == 'Windows'
shell: pwsh
run: |
$tarball = Get-ChildItem -Path . -Filter "petdex-*.tgz" | Select-Object -First 1
if (-not $tarball) {
throw "petdex package tarball was not created"
}
npx.cmd -y --package $tarball.FullName petdex --version