@@ -25,7 +25,7 @@ concurrency:
25
25
jobs :
26
26
cdk_changes :
27
27
name : Get Changes
28
- runs-on : ubuntu-24 .04
28
+ runs-on : ubuntu-22 .04
29
29
permissions :
30
30
statuses : write
31
31
pull-requests : read
62
62
# Forked PRs are handled by the community_ci.yml workflow
63
63
# If the condition is not met the job will be skipped (it will not fail)
64
64
# runs-on: connector-test-large
65
- runs-on : ubuntu-24 .04
65
+ runs-on : ubuntu-22 .04
66
66
timeout-minutes : 360 # 6 hours
67
67
strategy :
68
68
fail-fast : false
96
96
name : " Check: '${{matrix.connector}}' (skip=${{needs.cdk_changes.outputs['src'] == 'false' || needs.cdk_changes.outputs[matrix.cdk_extra] == 'false'}})"
97
97
permissions :
98
98
checks : write
99
+ contents : write # Required for creating commit statuses
100
+ pull-requests : read
99
101
steps :
100
102
- name : Abort if extra not changed (${{matrix.cdk_extra}})
101
103
id : no_changes
@@ -127,6 +129,22 @@ jobs:
127
129
uses : actions/setup-python@v5
128
130
with :
129
131
python-version : " 3.10"
132
+ # Create initial pending status for test report
133
+ - name : Create Pending Test Report Status
134
+ if : steps.no_changes.outputs.status != 'cancelled'
135
+ env :
136
+ GH_TOKEN : ${{ secrets.GH_PAT_MAINTENANCE_OCTAVIA }}
137
+ run : |
138
+ HEAD_SHA="${{ github.event.pull_request.head.sha || github.sha }}"
139
+ gh api \
140
+ --method POST \
141
+ -H "Accept: application/vnd.github+json" \
142
+ -H "X-GitHub-Api-Version: 2022-11-28" \
143
+ repos/${{ github.repository }}/statuses/$HEAD_SHA \
144
+ -f state="pending" \
145
+ -f description="Running connector tests..." \
146
+ -f context="${{ matrix.connector }} Test Report"
147
+
130
148
- name : Test Connector
131
149
if : steps.no_changes.outputs.status != 'cancelled'
132
150
timeout-minutes : 90
@@ -173,6 +191,39 @@ jobs:
173
191
echo "success=${success}" >> $GITHUB_OUTPUT
174
192
echo "html_report_url=${html_report_url}" >> $GITHUB_OUTPUT
175
193
194
+ # Update the test report status with results
195
+ - name : Update Test Report Status
196
+ if : always() && steps.no_changes.outputs.status != 'cancelled' && steps.evaluate_output.outcome == 'success'
197
+ env :
198
+ GH_TOKEN : ${{ secrets.GH_PAT_MAINTENANCE_OCTAVIA }}
199
+ run : |
200
+ HEAD_SHA="${{ github.event.pull_request.head.sha || github.sha }}"
201
+ gh api \
202
+ --method POST \
203
+ -H "Accept: application/vnd.github+json" \
204
+ -H "X-GitHub-Api-Version: 2022-11-28" \
205
+ repos/${{ github.repository }}/statuses/$HEAD_SHA \
206
+ -f state="${{ steps.evaluate_output.outputs.success == 'true' && 'success' || 'failure' }}" \
207
+ -f target_url="${{ steps.evaluate_output.outputs.html_report_url }}" \
208
+ -f description="Click Details to view the test report" \
209
+ -f context="${{ matrix.connector }} Test Report"
210
+
211
+ # Create failure status if report generation failed
212
+ - name : Create Report Generation Failed Status
213
+ if : always() && steps.no_changes.outputs.status != 'cancelled' && steps.evaluate_output.outcome != 'success'
214
+ env :
215
+ GH_TOKEN : ${{ secrets.GH_PAT_MAINTENANCE_OCTAVIA }}
216
+ run : |
217
+ HEAD_SHA="${{ github.event.pull_request.head.sha || github.sha }}"
218
+ gh api \
219
+ --method POST \
220
+ -H "Accept: application/vnd.github+json" \
221
+ -H "X-GitHub-Api-Version: 2022-11-28" \
222
+ repos/${{ github.repository }}/statuses/$HEAD_SHA \
223
+ -f state="failure" \
224
+ -f description="Failed to run connector tests." \
225
+ -f context="${{ matrix.connector }} Test Report"
226
+
176
227
# Upload the job output to the artifacts
177
228
- name : Upload Job Output
178
229
id : upload_job_output
0 commit comments