From e1750774226c0d3d905008b2a55d69441b1903f6 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Thu, 19 Sep 2024 17:54:02 +0800 Subject: [PATCH] polish Signed-off-by: Adrian Cole --- .github/workflows/ci.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3958425..d8a4fdb 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -55,7 +55,7 @@ jobs: - name: Cache Ollama models id: cache-ollama uses: actions/cache@v4 - with: # make the cache key based on where the OLLAMA_MODEL constant is defined. + with: # cache key is based on where OLLAMA_MODEL is defined. path: ~/.ollama/models # default directory for Ollama models key: ollama-${{ hashFiles('./src/exchange/providers/ollama.py') }} @@ -70,10 +70,13 @@ jobs: # Block using the ready endpoint mentioned in ollama/ollama#3341 time curl --retry 5 --retry-connrefused --retry-delay 0 -sf http://localhost:11434 - - name: Pull Ollama model + # First time pull, and first time execution of a model is slow, so we do + # this prior to running tests. This also reduces the chance of flakiness. + - name: Pull and Test Ollama model run: | # get the OLLAMA_MODEL from ./src/exchange/providers/ollama.py OLLAMA_MODEL=$(uv run python -c "from src.exchange.providers.ollama import OLLAMA_MODEL; print(OLLAMA_MODEL)") ollama pull $OLLAMA_MODEL || cat ollama.log + ollama run $OLLAMA_MODEL hello || cat ollama.log - name: Run Ollama tests run: uv run pytest tests -m integration -k ollama