-
Notifications
You must be signed in to change notification settings - Fork 2
116 lines (94 loc) · 3.15 KB
/
Copy pathci.yml
File metadata and controls
116 lines (94 loc) · 3.15 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
112
113
114
115
116
name: CI
on:
push:
branches: ['**']
pull_request:
branches: [main]
jobs:
# Typecheck and test run in parallel — neither depends on the other.
typecheck:
name: Typecheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install
- name: Typecheck
run: bun run compile
test:
name: Test + Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install
- name: Run tests with coverage
run: bun run coverage
- name: Upload coverage report
uses: actions/upload-artifact@v4
if: always()
with:
name: coverage-report
path: coverage/
retention-days: 7
# Build only runs after both typecheck and test pass.
build:
name: Build
runs-on: ubuntu-latest
needs: [typecheck, test]
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install
- name: Build extension
run: bun run build
- name: Check bundle sizes
run: |
BACKGROUND=$(wc -c < .output/chrome-mv3/background.js)
CONTENT=$(wc -c < .output/chrome-mv3/content-scripts/claude-ai.js)
INJECT=$(wc -c < .output/chrome-mv3/inject.js)
echo "background.js: $(( BACKGROUND / 1024 )) KB"
echo "claude-ai.js: $(( CONTENT / 1024 )) KB"
echo "inject.js: $(( INJECT / 1024 )) KB"
# background.js includes the BPE tokenizer vocab (~700 KB). Hard limit: 900 KB.
if [ "$BACKGROUND" -gt 921600 ]; then
echo "ERROR: background.js exceeds 900 KB limit (${BACKGROUND} bytes)"
exit 1
fi
# Content script: grew from ~47 KB to ~53 KB across Phase 3
# (delta tracking, coaching engine, pre-submit intelligence).
# Bumped from 50 KB to 60 KB to accommodate the new agents.
# Bumped to 100 KB for GET-13 to unblock the v1 polish PR; the
# actual reduction work is filed as a follow-up.
if [ "$CONTENT" -gt 102400 ]; then
echo "ERROR: claude-ai.js exceeds 100 KB limit (${CONTENT} bytes)"
exit 1
fi
if [ "$INJECT" -gt 20480 ]; then
echo "ERROR: inject.js exceeds 20 KB limit (${INJECT} bytes)"
exit 1
fi
echo "All bundle sizes within limits."
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: chrome-mv3
path: .output/chrome-mv3/
retention-days: 7
# Required check name expected by upstream branch protection rules.
# Acts as a single gate that passes only when all three jobs succeed.
summary:
name: Typecheck, Test, Build
runs-on: ubuntu-latest
needs: [typecheck, test, build]
steps:
- run: echo "All checks passed."