Skip to content

[codex] Track token usage per provider response #126

[codex] Track token usage per provider response

[codex] Track token usage per provider response #126

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
install:
name: Install dependencies
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 22
cache: npm
- run: npm ci
- uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 5
needs: install
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 22
- uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
- run: npm run lint
format:
name: Format
runs-on: ubuntu-latest
timeout-minutes: 5
needs: install
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 22
- uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
- run: npm run format:check
typecheck:
name: Type check
runs-on: ubuntu-latest
timeout-minutes: 5
needs: install
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 22
- uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
- run: npm run typecheck
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 5
needs: install
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 22
- uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
- run: npm run build
- uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4
with:
path: dist
key: dist-${{ github.sha }}
test:
name: Tests (Node ${{ matrix.node-version }})
runs-on: ubuntu-latest
timeout-minutes: 10
needs: build
strategy:
matrix:
node-version: [20, 22]
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: ${{ matrix.node-version }}
- uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
- uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4
with:
path: dist
key: dist-${{ github.sha }}
- run: npm test
security-audit:
name: Security audit
runs-on: ubuntu-latest
timeout-minutes: 5
needs: install
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 22
- uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
- run: npm audit --audit-level=critical
license-check:
name: License check
runs-on: ubuntu-latest
timeout-minutes: 5
needs: install
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 22
- uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
- run: npx license-checker --failOn "GPL-2.0;GPL-3.0;AGPL-3.0;LGPL-2.0;LGPL-2.1;LGPL-3.0;SSPL-1.0;EUPL-1.1;EUPL-1.2"
bundle-size:
name: Bundle size check
runs-on: ubuntu-latest
timeout-minutes: 5
needs: build
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 22
- uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
- uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4
with:
path: dist
key: dist-${{ github.sha }}
- run: npx size-limit
commitlint:
name: Lint commits
runs-on: ubuntu-latest
timeout-minutes: 10
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
fetch-depth: 0
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 22
cache: npm
- run: npm ci --ignore-scripts
- run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }}