-
Notifications
You must be signed in to change notification settings - Fork 51
111 lines (83 loc) · 3.48 KB
/
Copy pathcheck.yml
File metadata and controls
111 lines (83 loc) · 3.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
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%'