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

Commit 6d662c2

Browse files
chore: fix matrix
1 parent a1b8a40 commit 6d662c2

2 files changed

Lines changed: 25 additions & 80 deletions

File tree

.github/workflows/skill-validation.yml

Lines changed: 17 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -19,79 +19,16 @@ jobs:
1919
- uses: actions/checkout@v4
2020
- uses: astral-sh/setup-uv@v5
2121

22-
- name: Generate evaluation matrix
22+
- name: Generate matrix
2323
id: matrix
2424
env:
2525
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
PR_NUMBER: ${{ github.event.issue.number }}
27+
COMMENT: ${{ github.event.comment.body }}
2628
run: |
27-
python3 << 'MATRIX_SCRIPT'
28-
import subprocess
29-
import json
30-
import sys
31-
import os
32-
33-
# Detect modified skills
34-
result = subprocess.run(
35-
["python3", "ci/detect_changes.py", "${{ github.event.issue.number }}"],
36-
capture_output=True, text=True
37-
)
38-
modified_skills = result.stdout.strip().split() if result.stdout.strip() else []
39-
print(f"Modified skills: {modified_skills}")
40-
41-
# Extract filter from comment
42-
comment = "${{ github.event.comment.body }}"
43-
filter_provider = "all"
44-
if "/test copilot" in comment:
45-
filter_provider = "copilot"
46-
elif "/test ollama" in comment:
47-
filter_provider = "ollama"
48-
elif "/test gemini" in comment:
49-
filter_provider = "gemini"
50-
51-
# Generate base matrix
52-
result = subprocess.run(
53-
["uv", "run", "--with", "pyyaml", "ci/matrix_generator.py", "--filter-provider", filter_provider],
54-
capture_output=True, text=True, stderr=subprocess.DEVNULL
55-
)
56-
57-
if result.returncode != 0:
58-
print(f"Error generating matrix: {result.stderr}", file=sys.stderr)
59-
sys.exit(1)
60-
61-
# Extract JSON from output
62-
lines = result.stdout.strip().split('\n')
63-
json_lines = [l for l in lines if l.startswith('{') or l.startswith('[')]
64-
json_str = '\n'.join(json_lines)
65-
66-
try:
67-
base_matrix = json.loads(json_str)
68-
except json.JSONDecodeError as e:
69-
print(f"Error parsing matrix JSON: {e}", file=sys.stderr)
70-
print(f"Output was: {result.stdout}", file=sys.stderr)
71-
sys.exit(1)
72-
73-
# Expand matrix if skills were modified
74-
matrix = {"include": []}
75-
76-
if modified_skills and modified_skills[0]:
77-
print(f"Expanding matrix: {len(modified_skills)} skills × {len(base_matrix['include'])} models")
78-
for item in base_matrix["include"]:
79-
for skill in modified_skills:
80-
new_item = item.copy()
81-
new_item["skill"] = skill
82-
new_item["display_name"] = f"{item['display_name']} / {skill}"
83-
matrix["include"].append(new_item)
84-
else:
85-
print(f"Testing all skills: {len(base_matrix['include'])} models")
86-
matrix = base_matrix
87-
88-
# Output matrix
89-
matrix_json = json.dumps(matrix)
90-
print(f"Generated {len(matrix['include'])} jobs")
91-
92-
with open(os.environ.get('GITHUB_OUTPUT', ''), 'a') as f:
93-
f.write(f"result={matrix_json}\n")
94-
MATRIX_SCRIPT
29+
python3 ci/orchestrate_evaluations.py "$PR_NUMBER" --matrix-only --filter-provider all > /tmp/matrix.json
30+
MATRIX=$(cat /tmp/matrix.json)
31+
echo "result=$MATRIX" >> $GITHUB_OUTPUT
9532
9633
evaluate:
9734
needs: prepare
@@ -102,12 +39,16 @@ jobs:
10239

10340
steps:
10441
- uses: actions/checkout@v4
42+
10543
- uses: actions/setup-node@v4
44+
if: matrix.provider == 'copilot'
10645
with:
10746
node-version: '20'
47+
10848
- name: Install Copilot CLI
10949
if: matrix.provider == 'copilot'
11050
run: npm install -g @github/copilot
51+
11152
- uses: astral-sh/setup-uv@v5
11253
with:
11354
enable-cache: true
@@ -118,16 +59,12 @@ jobs:
11859
COPILOT_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11960
OLLAMA_API_KEY: ${{ secrets.OLLAMA_API_KEY }}
12061
run: |
121-
CMD="uv run --project tests --frozen tests/evaluator.py"
122-
CMD="$CMD --provider ${{ matrix.provider }} --model '${{ matrix.model }}'"
123-
CMD="$CMD --judge --verbose --report --threshold 50"
124-
[ -n "${{ matrix.extra_args }}" ] && CMD="$CMD ${{ matrix.extra_args }}"
125-
if [ -n "${{ matrix.skill }}" ]; then
126-
CMD="$CMD --skill ${{ matrix.skill }}"
127-
else
128-
CMD="$CMD --all"
129-
fi
130-
eval "$CMD"
62+
uv run --project tests --frozen tests/evaluator.py \
63+
--provider "${{ matrix.provider }}" \
64+
--model "${{ matrix.model }}" \
65+
--judge --verbose --report --threshold 50 \
66+
${{ matrix.extra_args }} \
67+
${{ matrix.skill && format('--skill {0}', matrix.skill) || '--all' }}
13168
13269
- name: Upload results
13370
if: always()
@@ -144,6 +81,7 @@ jobs:
14481

14582
steps:
14683
- uses: actions/checkout@v4
84+
14785
- uses: actions/download-artifact@v4
14886
with:
14987
path: tests/results/

ci/orchestrate_evaluations.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,11 +224,13 @@ def main():
224224
parser.add_argument("--filter-provider", default="all", help="Filter by provider")
225225
parser.add_argument("--parallel", action="store_true", help="Run in parallel (GitHub Actions mode)")
226226
parser.add_argument("--threshold", type=int, default=50, help="Pass threshold")
227+
parser.add_argument("--matrix-only", action="store_true", help="Only output matrix JSON and exit")
227228

228229
args = parser.parse_args()
229230

230231
# Validate environment
231-
validate_environment()
232+
if not args.matrix_only:
233+
validate_environment()
232234

233235
# Export for child scripts
234236
os.environ["PR_NUMBER"] = str(args.pr_number)
@@ -241,6 +243,11 @@ def main():
241243

242244
# Generate matrix (expand with per-skill jobs if skills detected)
243245
items = generate_matrix(args.filter_provider, modified_skills)
246+
247+
# If matrix-only mode, output JSON and exit
248+
if args.matrix_only:
249+
print(json.dumps({"include": items}))
250+
sys.exit(0)
244251

245252
# Clean previous results
246253
results_base = Path("tests/results")

0 commit comments

Comments
 (0)