-
Notifications
You must be signed in to change notification settings - Fork 2
209 lines (183 loc) · 5.9 KB
/
Copy pathbuild.yml
File metadata and controls
209 lines (183 loc) · 5.9 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# begin .github/workflows/build.yml
name: build
on:
push:
branches:
- main
- develop
- 'feature/**'
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install uv package manager
uses: astral-sh/setup-uv@v7
with:
version: "latest"
version-file: "pyproject.toml"
python-version: 3.11
enable-cache: true
- run: uv sync
- name: Run tests
run: |
. .venv/bin/activate
uv pip list
python3 -u -m pytest tests/
- name: Verify that the Docker image for the action builds
run: docker build . --file Dockerfile
integration-tests-action:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
include:
- model: gemini-2.5-flash
secret: GOOGLE_API_KEY
- model: grok-code-fast
secret: XAI_API_KEY
- model: claude-sonnet-4-20250514
secret: CLAUDE_API_KEY
- model: google/gemma-2-9b-it
secret: NVIDIA_NIM_API_KEY
- model: sonar
secret: PERPLEXITY_API_KEY
fail-fast: false
steps:
- uses: actions/checkout@v7
- name: Install uv package manager
uses: astral-sh/setup-uv@v7
with:
version: "latest"
version-file: "pyproject.toml"
python-version: 3.11
enable-cache: true
- run: uv sync
- name: Integration test ${{ matrix.model }}
id: integration
uses: ./
with:
report-files: tests/sample_report.json,tests/json_dict_div_zero_try_except.json
student-files: tests/sample_code.py
api-key: ${{ secrets[matrix.secret] }}
readme-path: tests/sample_readme.md
model: ${{ matrix.model }}
explanation-in: Korean
fail-expected: True
timeout-minutes: 5
- name: Output and Verify
run: |
echo "${{ matrix.model }} ${{ steps.integration.outputs.feedback }}"
echo "feedback_${{ matrix.model }}=${{ steps.integration.outputs.feedback }}" >> $GITHUB_OUTPUT
- name: Verify integration test results
run: |
. .venv/bin/activate
uv pip list
echo "feedback_${{ matrix.model }}=${{ steps.integration.outputs.feedback }}" >> $GITHUB_OUTPUT
python3 -u -m pytest tests/integration.py
integration-tests-env:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
model: [
claude-sonnet-4-20250514,
gemini-2.5-flash,
google/gemma-2-9b-it,
grok-code-fast,
sonar
]
fail-fast: false
steps:
- uses: actions/checkout@v7
- name: Install uv package manager
uses: astral-sh/setup-uv@v7
with:
version: "latest"
version-file: "pyproject.toml"
python-version: 3.11
enable-cache: true
- run: uv sync
- name: Integration test ${{ matrix.model }}
id: integration
env:
INPUT_REPORT-FILES: tests/sample_report.json,tests/json_dict_div_zero_try_except.json
INPUT_STUDENT-FILES: tests/sample_code.py
INPUT_README-PATH: tests/sample_readme.md
INPUT_CLAUDE_API_KEY: ${{ secrets.CLAUDE_API_KEY }}
INPUT_GEMINI-API-KEY: ${{ secrets.GOOGLE_API_KEY }}
INPUT_GROK-API-KEY: ${{ secrets.XAI_API_KEY }}
INPUT_NVIDIA-API-KEY: ${{ secrets.NVIDIA_NIM_API_KEY }}
INPUT_PERPLEXITY-API-KEY: ${{ secrets.PERPLEXITY_API_KEY }}
INPUT_MODEL: ${{ matrix.model }}
explanation-in: Korean
fail-expected: True
run: |
. .venv/bin/activate
uv pip list
sleep 1
python3 entrypoint.py
timeout-minutes: 5
- name: Output and Verify
run: |
echo "${{ matrix.model }} ${{ steps.integration.outputs.feedback }}"
echo "feedback_${{ matrix.model }}=${{ steps.integration.outputs.feedback }}" >> $GITHUB_OUTPUT
- name: Verify integration test results
run: |
. .venv/bin/activate
uv pip list
echo "feedback_${{ matrix.model }}=${{ steps.integration.outputs.feedback }}" >> $GITHUB_OUTPUT
python3 -u -m pytest tests/integration.py
integration-tests-codegen:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
include:
- model: gemini-2.5-flash
secret: GOOGLE_API_KEY
- model: grok-code-fast
secret: XAI_API_KEY
- model: claude-sonnet-4-20250514
secret: CLAUDE_API_KEY
- model: google/gemma-2-9b-it
secret: NVIDIA_NIM_API_KEY
- model: sonar
secret: PERPLEXITY_API_KEY
fail-fast: false
steps:
- uses: actions/checkout@v7
- name: Install uv package manager
uses: astral-sh/setup-uv@v7
with:
version: "latest"
version-file: "pyproject.toml"
python-version: 3.11
enable-cache: true
- run: uv sync
- name: Generate exercise.py with ${{ matrix.model }}
env:
INPUT_PROMPT-FILE: tests/sample_prompt.txt
CONTAINER_OUTPUT: ${{ runner.temp }}/codegen_output
INPUT_CLAUDE_API_KEY: ${{ secrets.CLAUDE_API_KEY }}
INPUT_GEMINI-API-KEY: ${{ secrets.GOOGLE_API_KEY }}
INPUT_GROK-API-KEY: ${{ secrets.XAI_API_KEY }}
INPUT_NVIDIA-API-KEY: ${{ secrets.NVIDIA_NIM_API_KEY }}
INPUT_PERPLEXITY-API-KEY: ${{ secrets.PERPLEXITY_API_KEY }}
INPUT_MODEL: ${{ matrix.model }}
run: |
. .venv/bin/activate
python3 prompt_pipeline/entrypoint.py
timeout-minutes: 5
- name: Show generated exercise.py
run: cat ${{ runner.temp }}/codegen_output/exercise.py
- name: Verify generated code
env:
CONTAINER_OUTPUT: ${{ runner.temp }}/codegen_output
run: |
. .venv/bin/activate
python3 -u -m pytest tests/integration_codegen.py -v
# end .github/workflows/build.yml