Skip to content

Commit 2f4f577

Browse files
committed
Test2
Signed-off-by: Jing Chen <[email protected]>
1 parent 0bbc905 commit 2f4f577

File tree

3 files changed

+41
-42
lines changed

3 files changed

+41
-42
lines changed
Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: Run examples
2+
name: Run examples (Jing)
33

44
on: [push, pull_request]
55

@@ -16,48 +16,48 @@ jobs:
1616

1717
steps:
1818

19-
# # Free up some disk space
20-
# - name: Remove unnecessary files
21-
# run: |
22-
# sudo rm -rf /usr/share/dotnet
23-
# sudo rm -rf "$AGENT_TOOLSDIRECTORY"
19+
# Free up some disk space
20+
- name: Remove unnecessary files
21+
run: |
22+
sudo rm -rf /usr/share/dotnet
23+
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
2424
25-
# # Set up Ollama
26-
# - name: Install Ollama and start server
27-
# shell: bash
28-
# run: |
29-
# curl -fsSL https://ollama.com/install.sh | sudo -E sh
25+
# Set up Ollama
26+
- name: Install Ollama and start server
27+
shell: bash
28+
run: |
29+
curl -fsSL https://ollama.com/install.sh | sudo -E sh
3030
31-
# - name: Pull models in examples/
32-
# shell: bash
33-
# run: |
34-
# ollama pull granite3.2:2b
35-
# ollama pull mxbai-embed-large
36-
# ollama list
31+
- name: Pull models in examples/
32+
shell: bash
33+
run: |
34+
ollama pull granite3.2:2b
35+
ollama pull mxbai-embed-large
36+
ollama list
3737
38-
# - name: Check that all required models are available
39-
# shell: bash
40-
# run: |
41-
# models=("mxbai-embed-large" "granite3.2:2b")
42-
# missing=0
43-
# for model in "${models[@]}"; do
44-
# if ! ollama list | awk 'NR>1 {print $1}' | grep -q "$model"; then
45-
# echo "❌ Model $model (or substring) is missing!"
46-
# missing=1
47-
# fi
48-
# done
38+
- name: Check that all required models are available
39+
shell: bash
40+
run: |
41+
models=("mxbai-embed-large" "granite3.2:2b")
42+
missing=0
43+
for model in "${models[@]}"; do
44+
if ! ollama list | awk 'NR>1 {print $1}' | grep -q "$model"; then
45+
echo "❌ Model $model (or substring) is missing!"
46+
missing=1
47+
fi
48+
done
4949
50-
# if [ "$missing" -eq 1 ]; then
51-
# exit 1
52-
# else
53-
# echo "✅ All expected models are available."
54-
# fi
50+
if [ "$missing" -eq 1 ]; then
51+
exit 1
52+
else
53+
echo "✅ All expected models are available."
54+
fi
5555
56-
# - name: Wait for Ollama server
57-
# shell: bash
58-
# run: |
59-
# sleep 10
60-
# time curl -i http://localhost:11434
56+
- name: Wait for Ollama server
57+
shell: bash
58+
run: |
59+
sleep 10
60+
time curl -i http://localhost:11434
6161
6262
# Run tests
6363
- uses: actions/checkout@v4
@@ -90,4 +90,4 @@ jobs:
9090
WATSONX_URL: ${{ secrets.WATSONX_URL }}
9191
REPLICATE_API_TOKEN: ${{ secrets.REPLICATE_API_TOKEN }}
9292
OLLAMA_GHACTIONS_RESULTS: true
93-
run: python env_test.py
93+
run: py.test -v --capture=tee-sys -rfE -s tests/test_examples_run.py

.github/workflows/run-examples.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,4 @@ jobs:
9191
WATSONX_APIKEY: ${{ secrets.WATSONX_APIKEY }}
9292
WATSONX_URL: ${{ secrets.WATSONX_URL }}
9393
REPLICATE_API_TOKEN: ${{ secrets.REPLICATE_API_TOKEN }}
94-
OLLAMA_GHACTIONS_RESULTS: True
95-
run: python env_test.py
94+
run: py.test -v --capture=tee-sys -rfE -s tests/test_examples_run.py

tests/test_examples_run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
UPDATE_RESULTS = True
2020
RESULTS_VERSION = 1
21-
OLLAMA_GHACTIONS_RESULTS_ENV_VAR = os.getenv("OLLAMA_GHACTIONS_RESULTS", "False")
21+
OLLAMA_GHACTIONS_RESULTS_ENV_VAR = os.getenv("OLLAMA_GHACTIONS_RESULTS", "")
2222
OLLAMA_GHACTIONS_RESULTS = False
2323
if OLLAMA_GHACTIONS_RESULTS_ENV_VAR.lower().strip() == "true":
2424
OLLAMA_GHACTIONS_RESULTS = True

0 commit comments

Comments
 (0)