Skip to content

fix(wintray): fold Grok CLI's tokens into Windows' today cost too (#119) #802

fix(wintray): fold Grok CLI's tokens into Windows' today cost too (#119)

fix(wintray): fold Grok CLI's tokens into Windows' today cost too (#119) #802

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
jobs:
check:
runs-on: macos-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
- run: uv python install 3.13
- run: uv sync --frozen --group dev
- name: Run ruff
run: uv run ruff check .
- name: Run mypy
run: uv run mypy .
- name: Run bilingual doc parity check
run: uv run python scripts/check_doc_parity.py
- name: Run file size ceiling check
run: uv run python scripts/check_file_size.py
- name: Run panel parity check
run: uv run python scripts/check_panel_parity.py
- name: Run pytest
run: uv run pytest -v
check-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
- run: uv python install 3.13
- run: uv sync --frozen --group dev --extra windows
- name: Run ruff
run: uv run ruff check .
- name: Run mypy
run: uv run mypy .
- name: Run pytest
run: uv run pytest -v
zero-install:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
- run: uv python install 3.13
- run: uv build --wheel
- name: Smoke-test installed wheel outside repository
shell: bash
run: |
mkdir -p "$RUNNER_TEMP/smoke"
uv venv "$RUNNER_TEMP/smoke/.venv" --python 3.13
uv pip install --python "$RUNNER_TEMP/smoke/.venv/bin/python" "$GITHUB_WORKSPACE"/dist/*.whl
cd "$RUNNER_TEMP/smoke"
"$RUNNER_TEMP/smoke/.venv/bin/usage" --version
"$RUNNER_TEMP/smoke/.venv/bin/usage" status --json | "$RUNNER_TEMP/smoke/.venv/bin/python" -c 'import json, sys; json.load(sys.stdin)'
# The status line is the one feature beyond the reports that Linux can
# actually run: the hook is stdlib-only and `usage setup` has no macOS or
# Windows gate on the Claude path. Nothing verified that, so this installs
# the hook against a throwaway HOME and feeds it a real statusLine payload.
- name: Smoke-test status-line hook against a throwaway HOME
shell: bash
env:
HOME: ${{ runner.temp }}/fake-home
run: |
mkdir -p "$HOME/.claude"
echo '{}' > "$HOME/.claude/settings.json"
"$RUNNER_TEMP/smoke/.venv/bin/usage" setup
test -x "$HOME/.claude/usage-statusline.py"
"$RUNNER_TEMP/smoke/.venv/bin/python" - <<'PY'
import json, pathlib, os
settings = json.loads((pathlib.Path(os.environ["HOME"]) / ".claude/settings.json").read_text())
command = settings["statusLine"]["command"]
assert "usage-statusline.py" in command, command
PY
printf '%s' '{"model":{"display_name":"Opus 5"},"workspace":{"project_dir":"/tmp/demo"},"context_window":{"used_percentage":24.0},"rate_limits":{"five_hour":{"used_percentage":33.0},"seven_day":{"used_percentage":88.0}}}' \
| python3 "$HOME/.claude/usage-statusline.py" | grep -q '33%'