Repository navigation
82 lines (75 loc) · 2.62 KB
/
Copy pathquality-generic.yml
File metadata and controls
82 lines (75 loc) · 2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Quality - Generic Subpackage
on:
workflow_call:
inputs:
subpackage:
required: true
type: string
description: "Path to subpackage (e.g., mellea_contribs/dspy_backend)"
python_versions:
required: false
type: string
description: "JSON array of Python versions (default: [\"3.11\", \"3.12\", \"3.13\"])"
timeout_minutes:
required: false
type: number
description: "Job timeout in minutes (default: 30)"
skip_ollama:
required: false
type: boolean
description: "Skip Ollama setup (default: false)"
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.ref_name }}-${{ inputs.subpackage }}
cancel-in-progress: true
env:
CICD: 1
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: ${{ inputs.timeout_minutes || 30 }}
env:
SUBPACKAGE: ${{ inputs.subpackage }}
strategy:
matrix:
python-version: ${{ fromJson(inputs.python_versions || '["3.11", "3.12", "3.13"]') }}
max-parallel: 1
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Free disk space
uses: ./.github/actions/free-disk-space
- name: Install Ollama (if needed)
if: ${{ !inputs.skip_ollama }}
run: |
curl -fsSL https://ollama.com/install.sh | sh
- name: Start serving ollama (if needed)
if: ${{ !inputs.skip_ollama }}
run: |
nohup ollama serve &
- name: Pull model granite4:micro (if needed)
if: ${{ !inputs.skip_ollama }}
run: |
ollama pull granite4:micro
- name: Install dependencies and run tests
run: |
cd "$SUBPACKAGE"
if ! command -v uv &> /dev/null; then
echo "Installing uv..."
pip install uv
fi
echo "Setting up virtual environment and installing dependencies..."
uv sync --all-extras
echo "Running tests..."
# Try multiple patterns to support both tests/ and test/ directories
if [ -d "tests" ]; then
uv run -- pytest -v tests/ --ignore=tests/integration
elif [ -d "test" ]; then
uv run -- pytest -v test/ --ignore=test/integration
else
echo "Error: No tests/ or test/ directory found"
exit 1
fi
- name: Send failure message
if: failure()
run: echo "Tests failed for $SUBPACKAGE. Please verify that tests are working locally."