Skip to content
This repository was archived by the owner on Jun 19, 2026. It is now read-only.

Commit f23a35e

Browse files
chore: Test Ollama Cloud (#3)
* chore: test ci * chore: test rnj-1 * chore: test rnj-1-cloud * chore: Better score and judgment. * chore: fix the failure threshold. * chore: fix the table report. * chore: Final judgment. * refactor(ci): scalable evaluation orchestration Applied programming skills to CI infrastructure: - Policy-Mechanism Separation: Config drives execution - Composition Over Coordination: Small focused scripts - Single Responsibility: Each script does one thing - Explicit Boundaries: Clear separation of concerns - Single Direction Data Flow: Clear pipeline Changes: - Renamed validate_skills.sh -> orchestrate_evaluations.sh - Created modular scripts: detect_changes, run_evaluation, consolidate_results - Enhanced matrix_generator.py with validation - Updated workflow for parallel execution support - Config-driven provider/model matrix Usage: /test # Run all enabled providers /test ollama # Run only ollama models /test parallel # Run in parallel (matrix strategy)
1 parent 3b0b398 commit f23a35e

30 files changed

Lines changed: 999 additions & 523 deletions

File tree

.github/workflows/full-evaluation.yml

Lines changed: 0 additions & 88 deletions
This file was deleted.

.github/workflows/skill-validation.yml

Lines changed: 137 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,69 @@ permissions:
99
contents: read
1010

1111
jobs:
12-
validate:
12+
# Job 1: Generate matrix from config
13+
prepare:
1314
runs-on: ubuntu-latest
1415
if: github.event.issue.pull_request && contains(github.event.comment.body, '/test') && github.actor == 'Ariel-Rodriguez'
16+
outputs:
17+
matrix: ${{ steps.generate-matrix.outputs.matrix }}
18+
filter: ${{ steps.parse.outputs.filter }}
19+
use-parallel: ${{ steps.parse.outputs.use-parallel }}
1520

1621
steps:
1722
- name: Parse test command
1823
id: parse
1924
run: |
2025
COMMENT="${{ github.event.comment.body }}"
26+
FILTER="all"
27+
USE_PARALLEL="false"
2128
22-
# Default provider
23-
PROVIDER="ollama"
24-
25-
# Check for specific provider
29+
# Check for specific provider filter
2630
if echo "$COMMENT" | grep -q "/test copilot"; then
27-
PROVIDER="copilot"
31+
FILTER="copilot"
2832
elif echo "$COMMENT" | grep -q "/test ollama"; then
29-
PROVIDER="ollama"
33+
FILTER="ollama"
34+
elif echo "$COMMENT" | grep -q "/test gemini"; then
35+
FILTER="gemini"
3036
elif echo "$COMMENT" | grep -q "/test all"; then
31-
PROVIDER="all"
37+
FILTER="all"
38+
fi
39+
40+
# Check for parallel flag
41+
if echo "$COMMENT" | grep -q "parallel"; then
42+
USE_PARALLEL="true"
3243
fi
3344
34-
echo "provider=$PROVIDER" >> $GITHUB_OUTPUT
35-
echo "Testing with provider: $PROVIDER"
45+
echo "filter=$FILTER" >> $GITHUB_OUTPUT
46+
echo "use-parallel=$USE_PARALLEL" >> $GITHUB_OUTPUT
47+
echo "Testing with filter: $FILTER (parallel: $USE_PARALLEL)"
3648
49+
- name: Checkout code
50+
uses: actions/checkout@v4
51+
52+
- name: Set up Python
53+
uses: actions/setup-python@v5
54+
with:
55+
python-version: '3.11'
56+
57+
- name: Install PyYAML
58+
run: pip install pyyaml
59+
60+
- name: Generate matrix
61+
id: generate-matrix
62+
run: |
63+
MATRIX=$(python3 ci/matrix_generator.py --filter-provider "${{ steps.parse.outputs.filter }}")
64+
echo "matrix=$MATRIX" >> $GITHUB_OUTPUT
65+
echo "Generated matrix:"
66+
echo "$MATRIX" | jq .
67+
68+
# Job 2: Run evaluations (parallel or sequential based on parse)
69+
evaluate:
70+
needs: prepare
71+
runs-on: ubuntu-latest
72+
if: needs.prepare.outputs.use-parallel == 'false'
73+
74+
steps:
3775
- name: Checkout code
3876
uses: actions/checkout@v4
3977
with:
@@ -55,18 +93,103 @@ jobs:
5593
- name: Set up Python
5694
run: uv python install 3.11
5795

58-
- name: Run Skill Validation
96+
- name: Run orchestration
5997
env:
6098
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6199
COPILOT_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62100
OLLAMA_API_KEY: ${{ secrets.OLLAMA_API_KEY }}
63101
run: |
64-
chmod +x ci/validate_skills.sh
65-
./ci/validate_skills.sh ${{ github.event.issue.number }} 50 ${{ steps.parse.outputs.provider }}
102+
chmod +x ci/*.sh
103+
./ci/orchestrate_evaluations.sh ${{ github.event.issue.number }} --filter-provider "${{ needs.prepare.outputs.filter }}"
66104
67-
- name: Post Benchmark Results
105+
- name: Post results
68106
uses: marocchino/sticky-pull-request-comment@v2
69107
if: always() && hashFiles('comment.md') != ''
70108
with:
71109
number: ${{ github.event.issue.number }}
72110
path: comment.md
111+
112+
# Job 3: Run evaluations in parallel (matrix strategy)
113+
evaluate-parallel:
114+
needs: prepare
115+
runs-on: ubuntu-latest
116+
if: needs.prepare.outputs.use-parallel == 'true'
117+
strategy:
118+
fail-fast: false
119+
matrix: ${{ fromJson(needs.prepare.outputs.matrix) }}
120+
121+
steps:
122+
- name: Checkout code
123+
uses: actions/checkout@v4
124+
with:
125+
ref: refs/pull/${{ github.event.issue.number }}/head
126+
127+
- name: Setup Node.js
128+
uses: actions/setup-node@v4
129+
with:
130+
node-version: '20'
131+
132+
- name: Install Copilot CLI
133+
if: matrix.provider == 'copilot'
134+
run: npm install -g @github/copilot
135+
136+
- name: Install uv
137+
uses: astral-sh/setup-uv@v5
138+
with:
139+
enable-cache: true
140+
141+
- name: Set up Python
142+
run: uv python install 3.11
143+
144+
- name: Detect changes
145+
id: changes
146+
env:
147+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
148+
run: |
149+
chmod +x ci/detect_changes.sh
150+
MODIFIED_SKILLS=$(./ci/detect_changes.sh ${{ github.event.issue.number }})
151+
echo "modified_skills=$MODIFIED_SKILLS" >> $GITHUB_OUTPUT
152+
153+
- name: Run evaluation for ${{ matrix.display_name }}
154+
env:
155+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
156+
COPILOT_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
157+
OLLAMA_API_KEY: ${{ secrets.OLLAMA_API_KEY }}
158+
MODIFIED_SKILLS: ${{ steps.changes.outputs.modified_skills }}
159+
run: |
160+
chmod +x ci/run_evaluation.sh
161+
./ci/run_evaluation.sh "${{ matrix.provider }}" "${{ matrix.model }}" 50 "${{ matrix.extra_args }}"
162+
163+
- name: Upload results
164+
uses: actions/upload-artifact@v4
165+
if: always()
166+
with:
167+
name: results-${{ matrix.provider }}-${{ matrix.model }}
168+
path: tests/results/${{ matrix.provider }}/${{ matrix.model }}/
169+
170+
# Job 4: Consolidate parallel results
171+
consolidate:
172+
needs: [prepare, evaluate-parallel]
173+
runs-on: ubuntu-latest
174+
if: needs.prepare.outputs.use-parallel == 'true' && always()
175+
176+
steps:
177+
- name: Checkout code
178+
uses: actions/checkout@v4
179+
180+
- name: Download all artifacts
181+
uses: actions/download-artifact@v4
182+
with:
183+
path: tests/results/
184+
185+
- name: Consolidate results
186+
run: |
187+
chmod +x ci/consolidate_results.sh
188+
./ci/consolidate_results.sh || true
189+
190+
- name: Post consolidated results
191+
uses: marocchino/sticky-pull-request-comment@v2
192+
if: hashFiles('comment.md') != ''
193+
with:
194+
number: ${{ github.event.issue.number }}
195+
path: comment.md

ci/collect-artifacts.sh

100644100755
File mode changed.

ci/config.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# CI Configuration for Skill Validation
2+
# Enable/disable providers and specify models to run in parallel matrix.
3+
4+
ollama:
5+
enabled: true
6+
local: false
7+
context: 32000
8+
models:
9+
- gpt-oss:20b-cloud
10+
- rnj-1:8b-cloud
11+
- devstral-small-2:24b-cloud
12+
13+
copilot:
14+
enabled: false
15+
models:
16+
- claude-3-5-sonnet
17+
- claude-3-haiku
18+
19+
gemini:
20+
enabled: false
21+
models:
22+
- gemini-1.5-flash
23+
- gemini-1.5-pro

ci/consolidate_results.sh

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# consolidate_results.sh
5+
# Consolidates results from multiple parallel evaluation runs.
6+
# Composition Over Coordination: Aggregates outputs from independent units.
7+
# Single Responsibility: Only consolidates, doesn't evaluate.
8+
9+
RESULTS_BASE="tests/results"
10+
11+
echo "==> Consolidating results from all evaluations"
12+
13+
# Find all result directories
14+
RESULT_DIRS=$(find "$RESULTS_BASE" -type d -name "*" -mindepth 2)
15+
16+
if [ -z "$RESULT_DIRS" ]; then
17+
echo "No results found in $RESULTS_BASE"
18+
exit 1
19+
fi
20+
21+
# Check for failures
22+
FAILED=0
23+
SUCCEEDED=0
24+
ALL_RESULTS=""
25+
26+
echo ""
27+
echo "Results by provider/model:"
28+
echo "=========================="
29+
30+
for dir in $RESULT_DIRS; do
31+
if [ ! -f "$dir/exit_code" ]; then
32+
continue
33+
fi
34+
35+
EXIT_CODE=$(cat "$dir/exit_code")
36+
PROVIDER_MODEL=$(echo "$dir" | sed "s|$RESULTS_BASE/||")
37+
38+
if [ "$EXIT_CODE" -eq 0 ]; then
39+
echo "$PROVIDER_MODEL - PASSED"
40+
SUCCEEDED=$((SUCCEEDED + 1))
41+
else
42+
echo "$PROVIDER_MODEL - FAILED (exit code: $EXIT_CODE)"
43+
FAILED=$((FAILED + 1))
44+
fi
45+
46+
# Collect summary if exists
47+
if [ -f "$dir/summary.json" ]; then
48+
ALL_RESULTS="$ALL_RESULTS\n### Results: $PROVIDER_MODEL\n"
49+
ALL_RESULTS="$ALL_RESULTS$(cat "$dir/summary.json")\n"
50+
fi
51+
done
52+
53+
echo ""
54+
echo "Summary:"
55+
echo "========"
56+
echo "Succeeded: $SUCCEEDED"
57+
echo "Failed: $FAILED"
58+
59+
# Generate consolidated comment for PR
60+
if [ -n "$PR_NUMBER" ] && [ "$FAILED" -eq 0 ]; then
61+
echo ""
62+
echo "Generating consolidated PR comment..."
63+
64+
COMMENT="## 🎉 All Evaluations Passed\n\n"
65+
COMMENT="${COMMENT}Tested across $SUCCEEDED provider/model combinations.\n\n"
66+
COMMENT="${COMMENT}${ALL_RESULTS}"
67+
68+
echo -e "$COMMENT" > comment.md
69+
echo "✓ Consolidated comment saved to comment.md"
70+
fi
71+
72+
# Exit with failure if any evaluation failed
73+
if [ "$FAILED" -gt 0 ]; then
74+
echo ""
75+
echo "$FAILED evaluation(s) failed"
76+
exit 1
77+
fi
78+
79+
echo ""
80+
echo "✅ All evaluations passed"
81+
exit 0

0 commit comments

Comments
 (0)