Commit 025460c
authored
🤖 perf: speed up CI with approx tokenizer and parallel static-check (#962)
Speeds up CI by:
1. **Approximate tokenizer for tests** - Defaults Jest to `length/4`
token counting instead of loading the 10s WASM tokenizer
2. **Parallel static-check** - Removes `-j3` limit, allowing all 6
subtasks to run in parallel
3. **Shallow checkout for tests** - Test jobs don't need full git
history
## Changes
### Tokenizer (`src/node/utils/main/tokenizer.ts`)
- Add `shouldUseApproxTokenizer()` that checks `MUX_APPROX_TOKENIZER=1`
- Short-circuit all tokenizer functions when in approx mode
- Override with `MUX_FORCE_REAL_TOKENIZER=1` for tests needing real
tokenization
### Test setup (`tests/setup.ts`)
- Default `MUX_APPROX_TOKENIZER=1` in Jest
### CI (`.github/workflows/pr.yml`)
- `make -j static-check` (was `-j3`)
- Remove `fetch-depth: 0` from test-unit, test-integration,
test-storybook, test-e2e
### Test fix (`src/cli/run.test.ts`)
- Update version test to accept both `vX.Y.Z` and hash-only formats
(shallow clones don't have tags)
_Generated with `mux`_1 parent a64c1c3 commit 025460c
File tree
4 files changed
+55
-11
lines changed- .github/workflows
- src
- cli
- node/utils/main
- tests
4 files changed
+55
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
90 | | - | |
91 | 89 | | |
92 | 90 | | |
93 | 91 | | |
| |||
106 | 104 | | |
107 | 105 | | |
108 | 106 | | |
109 | | - | |
110 | | - | |
111 | 107 | | |
112 | 108 | | |
113 | 109 | | |
| |||
146 | 142 | | |
147 | 143 | | |
148 | 144 | | |
149 | | - | |
150 | | - | |
151 | 145 | | |
152 | 146 | | |
153 | 147 | | |
| |||
171 | 165 | | |
172 | 166 | | |
173 | 167 | | |
174 | | - | |
175 | | - | |
176 | 168 | | |
177 | 169 | | |
178 | 170 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
106 | | - | |
| 105 | + | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 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 | + | |
21 | 46 | | |
22 | 47 | | |
23 | 48 | | |
| |||
138 | 163 | | |
139 | 164 | | |
140 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
141 | 174 | | |
142 | 175 | | |
143 | 176 | | |
| |||
151 | 184 | | |
152 | 185 | | |
153 | 186 | | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
154 | 191 | | |
155 | 192 | | |
156 | 193 | | |
| |||
161 | 198 | | |
162 | 199 | | |
163 | 200 | | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
164 | 205 | | |
165 | 206 | | |
166 | 207 | | |
167 | 208 | | |
168 | 209 | | |
169 | 210 | | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
170 | 216 | | |
171 | 217 | | |
172 | 218 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
10 | 16 | | |
11 | 17 | | |
12 | 18 | | |
| |||
0 commit comments