Files
iot-dc3/.github/workflows/ci-cli.yml
T
pnokerandClaude Code b588204110 feat(cli): adopt the remaining guardian tests and auth store fix
adopts the remaining uncommitted work from the parallel session:
five new guardian test files (client-errors, device-import-template,
entity-id-guard, jwt-guard, option-hygiene) that lock in the error
taxonomy, id encoding, and cli option hygiene; an attachment file
cleaner in the agentic service; attachment controller and service
tests; a salt-type fix in the auth store; ci workflow typecheck step;
and the cli test report. 818 tests total across 37 files.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-06 21:26:15 +08:00

84 lines
2.1 KiB
YAML

name: CLI CI
on:
pull_request:
paths:
- dc3-cli/**
push:
branches:
- main
- develop
paths:
- dc3-cli/**
workflow_dispatch:
permissions:
contents: read
concurrency:
group: cli-ci-${{ github.ref }}
cancel-in-progress: true
jobs:
quality:
runs-on: ubuntu-latest
timeout-minutes: 25
defaults:
run:
working-directory: dc3-cli
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
- name: Set pnpm
uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86
with:
package_json_file: dc3-cli/package.json
- name: Set Node
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020
with:
node-version: 22
cache: pnpm
cache-dependency-path: dc3-cli/pnpm-lock.yaml
- name: Install
run: pnpm install --frozen-lockfile
- name: Lint Check
run: pnpm exec eslint src test
- name: Typecheck
run: pnpm typecheck
- name: Typecheck Tests
run: pnpm typecheck:test
- name: Test
run: pnpm test
- name: Coverage
run: pnpm test:coverage
- name: Build
run: pnpm build
- name: Smoke — behavioral dist invocations
run: |
# Help surface: the built artifact lists the command groups.
node dist/index.js --help | grep -E "auth|device|tools"
node dist/index.js auth login --help > /dev/null
# Bare invocation: help on stdout, exit 0 (report F048).
node dist/index.js > bare.out
grep -q "Usage: dc3" bare.out
# Unknown command: exit 1, one human line on stderr, machine
# envelope on stdout (report F015 failure contract).
set +e
node dist/index.js definitely-not-a-command > unknown.out 2> unknown.err
status=$?
set -e
test "$status" -eq 1
test "$(wc -l < unknown.err)" -eq 1
grep -q '"ok":false' unknown.out
grep -q '"kind":"usage"' unknown.out