Skip to content

refactor: replace ecosystem if-chains with IEcosystemAdapter registry #444

refactor: replace ecosystem if-chains with IEcosystemAdapter registry

refactor: replace ecosystem if-chains with IEcosystemAdapter registry #444

Workflow file for this run

name: CLI - Build & Validate
on:
push:
branches: [main]
paths:
- 'cli/**'
- 'vscode-extension/src/sessionDiscovery.ts'
- 'vscode-extension/src/sessionParser.ts'
- 'vscode-extension/src/tokenEstimation.ts'
- 'vscode-extension/src/maturityScoring.ts'
- 'vscode-extension/src/usageAnalysis.ts'
- 'vscode-extension/src/opencode.ts'
- 'vscode-extension/src/types.ts'
- 'vscode-extension/src/tokenEstimators.json'
- 'vscode-extension/src/modelPricing.json'
- 'vscode-extension/src/toolNames.json'
pull_request:
branches: [main]
permissions:
contents: read
jobs:
check-changes:
runs-on: ubuntu-latest
outputs:
cli-relevant: ${{ github.event_name == 'push' || steps.filter.outputs.cli-relevant == 'true' }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@6c3c2f2c1c457b00c10c4848d6f5491db3b629df # v2.18.0
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Check for CLI-relevant file changes
if: github.event_name == 'pull_request'
uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
id: filter
with:
filters: |
cli-relevant:
- 'cli/**'
- 'vscode-extension/src/sessionDiscovery.ts'
- 'vscode-extension/src/sessionParser.ts'
- 'vscode-extension/src/tokenEstimation.ts'
- 'vscode-extension/src/maturityScoring.ts'
- 'vscode-extension/src/usageAnalysis.ts'
- 'vscode-extension/src/opencode.ts'
- 'vscode-extension/src/types.ts'
- 'vscode-extension/src/tokenEstimators.json'
- 'vscode-extension/src/modelPricing.json'
- 'vscode-extension/src/toolNames.json'
build-and-validate:
needs: check-changes
if: needs.check-changes.outputs.cli-relevant == 'true'
runs-on: ubuntu-latest
env:
node-version: 24
steps:
- name: Harden Runner
uses: step-security/harden-runner@6c3c2f2c1c457b00c10c4848d6f5491db3b629df # v2.18.0
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Node.js ${{ env.node-version }}
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.node-version }}
- name: Install extension dependencies
working-directory: vscode-extension
run: npm ci
- name: Install CLI dependencies
working-directory: cli
run: npm ci
- name: Build CLI
working-directory: cli
run: npm run build
- name: Validate CLI --help
working-directory: cli
run: node dist/cli.js --help
- name: Validate CLI --version
working-directory: cli
run: node dist/cli.js --version
- name: Validate stats command
working-directory: cli
run: node dist/cli.js stats --verbose
- name: Validate usage command
working-directory: cli
run: node dist/cli.js usage
- name: Validate environmental command
working-directory: cli
run: node dist/cli.js environmental
- name: Validate fluency command
working-directory: cli
run: node dist/cli.js fluency --tips
- name: Validate diagnostics command
working-directory: cli
run: node dist/cli.js diagnostics
- name: Validate chart command
working-directory: cli
run: node dist/cli.js chart --json
- name: Validate usage-analysis command
working-directory: cli
run: node dist/cli.js usage-analysis --json
- name: Validate all command (batched data for Visual Studio extension)
working-directory: cli
run: node dist/cli.js all --json
- name: Build production bundle
working-directory: cli
run: npm run build:production
- name: Verify production bundle runs
working-directory: cli
run: node dist/cli.js --help