From b4a170cb8afc9e1cd19800bdd5ed41bf0ba9ec4f Mon Sep 17 00:00:00 2001 From: Bowen Liang Date: Thu, 4 Jan 2024 15:31:07 +0800 Subject: [PATCH] ci: Properly cache pip packages (#1912) --- .github/workflows/api-model-runtime-tests.yml | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/.github/workflows/api-model-runtime-tests.yml b/.github/workflows/api-model-runtime-tests.yml index a263d033e3..640894f2a1 100644 --- a/.github/workflows/api-model-runtime-tests.yml +++ b/.github/workflows/api-model-runtime-tests.yml @@ -31,28 +31,19 @@ jobs: HUGGINGFACE_EMBEDDINGS_ENDPOINT_URL: c MOCK_SWITCH: true - steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: '3.10' - - - name: Cache pip dependencies - uses: actions/cache@v2 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('api/requirements.txt') }} - restore-keys: ${{ runner.os }}-pip- + cache: 'pip' + cache-dependency-path: ./api/requirements.txt - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install pytest - pip install -r api/requirements.txt + run: pip install -r ./api/requirements.txt - name: Run pytest run: pytest api/tests/integration_tests/model_runtime/anthropic api/tests/integration_tests/model_runtime/azure_openai api/tests/integration_tests/model_runtime/openai api/tests/integration_tests/model_runtime/chatglm api/tests/integration_tests/model_runtime/google api/tests/integration_tests/model_runtime/xinference api/tests/integration_tests/model_runtime/huggingface_hub/test_llm.py