Skip to content

Commit 36836a1

Browse files
committed
chore: add embedding model in env for backend tests workflow
1 parent 53f3be2 commit 36836a1

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

.github/workflows/backend-tests.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ jobs:
1414
name: Unit Tests
1515
runs-on: ubuntu-latest
1616
if: github.event.pull_request.draft == false
17+
env:
18+
EMBEDDING_MODEL: sentence-transformers/all-MiniLM-L6-v2
1719

1820
steps:
1921
- name: Checkout code
@@ -48,6 +50,13 @@ jobs:
4850
restore-keys: |
4951
python-deps-
5052
53+
- name: Cache HuggingFace models
54+
if: steps.backend-changes.outputs.backend == 'true'
55+
uses: actions/cache@v5
56+
with:
57+
path: ~/.cache/huggingface
58+
key: hf-models-${{ env.EMBEDDING_MODEL }}
59+
5160
- name: Install dependencies
5261
if: steps.backend-changes.outputs.backend == 'true'
5362
working-directory: surfsense_backend
@@ -62,6 +71,8 @@ jobs:
6271
name: Integration Tests
6372
runs-on: ubuntu-latest
6473
if: github.event.pull_request.draft == false
74+
env:
75+
EMBEDDING_MODEL: sentence-transformers/all-MiniLM-L6-v2
6576

6677
services:
6778
postgres:
@@ -111,6 +122,13 @@ jobs:
111122
restore-keys: |
112123
python-deps-
113124
125+
- name: Cache HuggingFace models
126+
if: steps.backend-changes.outputs.backend == 'true'
127+
uses: actions/cache@v5
128+
with:
129+
path: ~/.cache/huggingface
130+
key: hf-models-${{ env.EMBEDDING_MODEL }}
131+
114132
- name: Install dependencies
115133
if: steps.backend-changes.outputs.backend == 'true'
116134
working-directory: surfsense_backend

0 commit comments

Comments
 (0)