@@ -41,37 +41,27 @@ jobs:
4141 uses : actions/setup-python@v5
4242 with :
4343 python-version : ${{ matrix.python-version }}
44+ cache : ' pip'
4445
4546 - name : Install dependencies
4647 run : |
4748 pip install --upgrade pip
4849 pip install -e .[dev]
4950
50- - name : Build source-only grammars (while memory is fresh)
51- run : |
52- # Build grammars BEFORE trying sentence-transformers since
53- # torch/cuBLAS can fragment memory and cause OOM during builds
54- ./scripts/build-source-grammars
51+ - name : Build source-only grammars
52+ run : ./scripts/build-source-grammars
5553
56- - name : Try installing sentence-transformers (optional)
54+ - name : Check for sentence-transformers
5755 run : |
58- echo "Attempting to install sentence-transformers..."
59- if timeout 300 pip install sentence-transformers 2>&1; then
60- echo "sentence-transformers installed successfully"
56+ # Don't try to install - just check if it's already available.
57+ # Installing sentence-transformers on small runners often times out.
58+ if python -c "import sentence_transformers" 2>/dev/null; then
59+ echo "sentence-transformers available"
6160 echo "EMBEDDINGS_AVAILABLE=true" >> "$GITHUB_ENV"
6261 else
63- echo "::warning:: sentence-transformers install failed (expected on small runners) "
62+ echo "sentence-transformers not installed, embedding tests will be skipped "
6463 echo "EMBEDDINGS_AVAILABLE=false" >> "$GITHUB_ENV"
6564 fi
66- continue-on-error : true
67-
68- - name : Contingency reinstall (if sentence-transformers failed)
69- if : always() && env.EMBEDDINGS_AVAILABLE != 'true'
70- run : |
71- echo "Reinstalling clean [dev] dependencies..."
72- pip cache purge 2>/dev/null || true
73- pip uninstall -y sentence-transformers torch transformers huggingface_hub safetensors 2>/dev/null || true
74- pip install -e .[dev] --force-reinstall
7565
7666 - name : Run tests with coverage
7767 run : |
9787 uses : actions/setup-python@v5
9888 with :
9989 python-version : ' 3.11'
90+ cache : ' pip'
10091
10192 - name : Install dependencies
10293 run : |
@@ -141,24 +132,16 @@ jobs:
141132 uses : actions/setup-python@v5
142133 with :
143134 python-version : ' 3.11'
135+ cache : ' pip'
144136
145137 - name : Install dependencies
146138 run : |
147139 pip install --upgrade pip
148140 pip install -e .[dev]
149141
150- - name : Build source-only grammars (while memory is fresh)
142+ - name : Build source-only grammars
151143 run : ./scripts/build-source-grammars
152144
153- - name : Try installing sentence-transformers (optional)
154- run : |
155- if timeout 300 pip install sentence-transformers 2>&1; then
156- echo "sentence-transformers installed successfully"
157- else
158- echo "::warning::sentence-transformers install failed (expected on small runners)"
159- fi
160- continue-on-error : true
161-
162145 - name : Install jq
163146 run : |
164147 sudo apt-get update && sudo apt-get install -y jq || true
@@ -180,6 +163,7 @@ jobs:
180163 uses : actions/setup-python@v5
181164 with :
182165 python-version : ' 3.11'
166+ cache : ' pip'
183167
184168 - name : Install build tools
185169 run : |
0 commit comments