Spaces:
Sleeping

Divb30 commited on
Commit
d9bbdfd
·
1 Parent(s): 6d50eaf

ruff, tests and eval on every push. had to pin transformers <4.46 and numpy <2, the newer ones break the import

Files changed (1) hide show
  1. .github/workflows/ci.yml +54 -0
.github/workflows/ci.yml ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ lint:
11
+ name: Lint (ruff)
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ - uses: actions/setup-python@v5
16
+ with:
17
+ python-version: "3.11"
18
+ - name: Install ruff
19
+ run: pip install ruff
20
+ - name: Lint
21
+ run: ruff check src/ tests/ eval/ app.py
22
+
23
+ test:
24
+ name: Tests + eval gate
25
+ runs-on: ubuntu-latest
26
+ steps:
27
+ - uses: actions/checkout@v4
28
+ - uses: actions/setup-python@v5
29
+ with:
30
+ python-version: "3.11"
31
+
32
+ # Cache HuggingFace model downloads (embedding + cross-encoder) across runs.
33
+ - name: Cache HuggingFace models
34
+ uses: actions/cache@v4
35
+ with:
36
+ path: ~/.cache/huggingface
37
+ key: hf-models-${{ runner.os }}-v1
38
+
39
+ # Install the CPU-only torch build first so the eval never pulls the
40
+ # multi-GB CUDA wheel — CI runs entirely on CPU.
41
+ - name: Install CPU torch
42
+ run: pip install torch --index-url https://download.pytorch.org/whl/cpu
43
+
44
+ - name: Install package
45
+ run: pip install -e ".[dev,eval]"
46
+
47
+ - name: Unit + integration tests
48
+ run: pytest tests/unit/ tests/integration/ -v --tb=short
49
+
50
+ - name: Evaluation quality gate
51
+ run: pytest tests/eval/ -v --tb=short
52
+
53
+ - name: Coverage report
54
+ run: pytest tests/ --cov=intellicode --cov-report=term-missing -q