Skip to content

Commit 2af15d3

Browse files
committed
Dispatch compiler compatibility testing
1 parent 427b94f commit 2af15d3

1 file changed

Lines changed: 64 additions & 0 deletions

File tree

.github/workflows/validate-release.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,70 @@ jobs:
158158
--input - \
159159
/repos/$GITHUB_REPOSITORY/check-runs/$CHECK_RUN_ID
160160
161+
pre-validate-compiler-compatibility:
162+
outputs:
163+
check-run-id: ${{ steps.create-check-run.outputs.check-run-id }}}
164+
needs: [determine-ref]
165+
runs-on: ubuntu-latest
166+
steps:
167+
- name: Create check run
168+
id: create-check-run
169+
env:
170+
GH_TOKEN: ${{ github.token }}
171+
RELEASE_REF: ${{ needs.determine-ref.outputs.ref }}
172+
run: |
173+
check_run_id=$(gh api \
174+
--header "Accept: application/vnd.github+json" \
175+
--header "X-GitHub-Api-Version: 2022-11-28" \
176+
--field name="compiler-compatibility-test" \
177+
--field head_sha="$RELEASE_REF" \
178+
--jq ".id" \
179+
/repos/$GITHUB_REPOSITORY/check-runs)
180+
181+
echo "check-run-id=$check_run_id" >> "$GITHUB_OUTPUT"
182+
183+
validate-compiler-compatibility:
184+
needs: [pre-validate-compiler-compatibility, determine-ref]
185+
runs-on: ubuntu-latest
186+
steps:
187+
- name: Invoke performance test
188+
env:
189+
RELEASE_REF: ${{ needs.determine-ref.outputs.ref }}
190+
CHECK_RUN_ID: ${{ needs.pre-validate-release-performance.outputs.check-run-id }}
191+
GH_TOKEN: ${{ secrets.release-engineering-token }}
192+
run: |
193+
jq -n \
194+
--arg ref "$RELEASE_REF" \
195+
--arg check_run_id "$CHECK_RUN_ID" \
196+
'{ref: $ref, "check-run-id": $check_run_id}' \
197+
| \
198+
gh workflow run release-performance-validation.yml \
199+
--json \
200+
-R github/codeql-coding-standards-release-engineering \
201+
--ref rvermeulen/release-process
202+
203+
on-failure-validate-compiler-compatibility-dispatch:
204+
needs: [pre-validate-compiler-compatibility, validate-compiler-compatibility]
205+
if: failure()
206+
runs-on: ubuntu-latest
207+
steps:
208+
- name: Fail check run status
209+
env:
210+
CHECK_RUN_ID: ${{ needs.pre-validate-release-performance.outputs.check-run-id }}
211+
GITHUB_TOKEN: ${{ github.token }}
212+
run: |
213+
jq -n \
214+
--arg status "completed" \
215+
--arg conclusion "failed" \
216+
'{status: $status, conclusion: $conclusion}' \
217+
| \
218+
gh api \
219+
--method PATCH \
220+
--header "Accept: application/vnd.github+json" \
221+
--header "X-GitHub-Api-Version: 2022-11-28" \
222+
--input - \
223+
/repos/$GITHUB_REPOSITORY/check-runs/$CHECK_RUN_ID
224+
161225
create-release-status-check-run:
162226
name: "Initialize release status monitoring"
163227
needs: [determine-ref]

0 commit comments

Comments
 (0)