Skip to content

Commit b49e2d5

Browse files
authored
Run API tests once (#306)
Run API-dependent tests once per matrix run.
1 parent af7871c commit b49e2d5

File tree

1 file changed

+9
-25
lines changed

1 file changed

+9
-25
lines changed

.github/workflows/test.yml

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ env:
1717
POETRY_VERSION: "1.8.3"
1818

1919
jobs:
20-
prime-cache:
21-
name: Prime HuggingFace Model Cache
20+
service-tests:
21+
name: Service Tests
2222
runs-on: ubuntu-latest
2323
env:
2424
HF_HOME: ${{ github.workspace }}/hf_cache
@@ -38,10 +38,10 @@ jobs:
3838
mkdir -p ~/.huggingface
3939
echo '{"token":"${{ secrets.HF_TOKEN }}"}' > ~/.huggingface/token
4040
41-
- name: Set up Python 3.9
41+
- name: Set up Python 3.11
4242
uses: actions/setup-python@v4
4343
with:
44-
python-version: 3.9
44+
python-version: 3.11
4545
cache: pip
4646

4747
- name: Install Poetry
@@ -58,7 +58,7 @@ jobs:
5858
with:
5959
credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }}
6060

61-
- name: Run full test suite to prime cache
61+
- name: Run full test suite and prime the HF cache
6262
env:
6363
HF_TOKEN: ${{ secrets.HF_TOKEN }}
6464
HF_HOME: ${{ github.workspace }}/hf_cache
@@ -80,13 +80,14 @@ jobs:
8080
test:
8181
name: Python ${{ matrix.python-version }} - ${{ matrix.connection }} [redis ${{ matrix.redis-version }}]
8282
runs-on: ubuntu-latest
83-
needs: prime-cache
83+
needs: service-tests
8484
env:
8585
HF_HOME: ${{ github.workspace }}/hf_cache
8686
strategy:
8787
fail-fast: false
8888
matrix:
89-
python-version: ["3.10", "3.11", 3.12, 3.13]
89+
# 3.11 tests are run in the service-tests job
90+
python-version: ["3.9", "3.10", 3.12, 3.13]
9091
connection: ["hiredis", "plain"]
9192
redis-version: ["6.2.6-v9", "latest", "8.0-M03"]
9293

@@ -133,30 +134,14 @@ jobs:
133134
with:
134135
credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }}
135136

136-
- name: Set HuggingFace token
137-
run: |
138-
mkdir -p ~/.huggingface
139-
echo '{"token":"${{ secrets.HF_TOKEN }}"}' > ~/.huggingface/token
140-
141137
- name: Run tests
142138
if: matrix.connection == 'plain' && matrix.redis-version == 'latest'
143139
env:
144140
HF_HOME: ${{ github.workspace }}/hf_cache
145-
OPENAI_API_KEY: ${{ secrets.OPENAI_KEY }}
146141
GCP_LOCATION: ${{ secrets.GCP_LOCATION }}
147142
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
148-
COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }}
149-
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
150-
VOYAGE_API_KEY: ${{ secrets.VOYAGE_API_KEY }}
151-
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
152-
AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }}
153-
AZURE_OPENAI_DEPLOYMENT_NAME: ${{ secrets.AZURE_OPENAI_DEPLOYMENT_NAME }}
154-
OPENAI_API_VERSION: ${{ secrets.OPENAI_API_VERSION }}
155-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
156-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
157-
HF_TOKEN: ${{ secrets.HF_TOKEN }}
158143
run: |
159-
make test-all
144+
make test
160145
161146
- name: Run tests (alternate)
162147
if: matrix.connection != 'plain' || matrix.redis-version != 'latest'
@@ -182,7 +167,6 @@ jobs:
182167
HF_TOKEN: ${{ secrets.HF_TOKEN }}
183168
run: |
184169
docker run -d --name redis -p 6379:6379 redis/redis-stack-server:latest
185-
make test-notebooks
186170
if [[ "${{ matrix.python-version }}" > "3.9" ]]; then
187171
make test-notebooks
188172
else

0 commit comments

Comments
 (0)