[SYCL][Graph] Add tests checking event status querying #44
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test windows on the comment | |
on: | |
issue_comment: | |
types: [created] | |
jobs: | |
windows_test_preparation: | |
runs-on: ubuntu-20.04 | |
if: ${{ github.event.issue.pull_request && github.event.comment.body == '/testwin' }} | |
steps: | |
- name: react_to_comment | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
github.rest.reactions.createForIssueComment({ | |
owner: context.issue.owner, | |
repo: context.issue.repo, | |
comment_id: context.payload.comment.id, | |
content: "rocket" | |
}); | |
- name: get_pr_sha | |
id: sha | |
uses: actions/github-script@v6 | |
with: | |
result-encoding: string | |
script: | | |
const pr = await github.rest.pulls.get({ | |
owner: context.issue.owner, | |
repo: context.issue.repo, | |
pull_number: context.issue.number | |
}); | |
return pr.data.head.sha | |
- name: update_pr_status_pending | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
OWNER: ${{ github.repository_owner }} | |
REPO: ${{ github.event.repository.name }} | |
SHA: ${{ steps.sha.outputs.result }} | |
run: | | |
gh api --method POST -H "Accept: application/vnd.github+json" /repos/$OWNER/$REPO/statuses/$SHA -f state='pending' -f target_url='${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}' -f description='Working on testing. This will take a while' -f context='Windows pre-commit' | |
outputs: | |
PR_SHA: ${{ steps.sha.outputs.result }} | |
test_matrix: | |
name: Generate Test Matrix | |
needs: [windows_test_preparation] | |
if: github.repository == 'intel/llvm' | |
uses: ./.github/workflows/sycl_gen_test_matrix.yml | |
with: | |
lts_config: "win_l0_gen12" | |
windows_default: | |
name: Windows | |
needs: [windows_test_preparation, test_matrix] | |
if: github.repository == 'intel/llvm' | |
uses: ./.github/workflows/sycl_windows_build_and_test.yml | |
with: | |
build_ref: ${{ needs.windows_test_preparation.outputs.PR_SHA }} | |
lts_matrix: ${{ needs.test_matrix.outputs.lts_wn_matrix }} | |
windows_test_completion: | |
runs-on: ubuntu-20.04 | |
needs: [windows_test_preparation, windows_default] | |
if: ${{ always() && needs.windows_test_preparation.result != 'skipped' }} | |
steps: | |
- name: update_pr_status_success | |
if: needs.windows_default.result == 'success' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
OWNER: ${{ github.repository_owner }} | |
REPO: ${{ github.event.repository.name }} | |
SHA: ${{ needs.windows_test_preparation.outputs.PR_SHA }} | |
run: | | |
gh api --method POST -H "Accept: application/vnd.github+json" /repos/$OWNER/$REPO/statuses/$SHA -f state='success' -f target_url='${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}' -f description='The operation completed successfully' -f context='Windows pre-commit' | |
- name: update_pr_status_failure | |
if: needs.windows_default.result == 'failure' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
OWNER: ${{ github.repository_owner }} | |
REPO: ${{ github.event.repository.name }} | |
SHA: ${{ needs.windows_test_preparation.outputs.PR_SHA }} | |
run: | | |
gh api --method POST -H "Accept: application/vnd.github+json" /repos/$OWNER/$REPO/statuses/$SHA -f state='failure' -f target_url='${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}' -f description='Testing failed successfully' -f context='Windows pre-commit' |