Skip to content

Commit 017bcdc

Browse files
authored
[SYCL] Fix for windows on comment github action testing (#7841)
Move env section earlier so that $SHA is initialized before run section. Remove commented out code.
1 parent ab117f7 commit 017bcdc

File tree

1 file changed

+10
-20
lines changed

1 file changed

+10
-20
lines changed

.github/workflows/windows_test_comment_trigger.yml

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
jobs:
88
windows_test_preparation:
99
runs-on: ubuntu-latest
10-
if: ${{ github.event.issue.pull_request && github.event.comment.body == '/start Windows testing' }}
10+
if: ${{ github.event.issue.pull_request && github.event.comment.body == '/testwin' }}
1111
steps:
1212
- name: react_to_comment
1313
uses: actions/github-script@v4
@@ -34,14 +34,13 @@ jobs:
3434
});
3535
return pr.data.head.sha
3636
- name: update_pr_status_pending
37-
run: |
38-
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='The build started2!' -f context='Windows pre-commit'
39-
echo "REF == = = = = = = ${{ steps.sha.outputs.result }}"
4037
env:
4138
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4239
OWNER: ${{ github.repository_owner }}
4340
REPO: ${{ github.event.repository.name }}
4441
SHA: ${{ steps.sha.outputs.result }}
42+
run: |
43+
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'
4544
outputs:
4645
PR_SHA: ${{ steps.sha.outputs.result }}
4746

@@ -56,32 +55,23 @@ jobs:
5655

5756
windows_test_completion:
5857
runs-on: ubuntu-latest
59-
needs: [windows_default]
58+
needs: [windows_test_preparation, windows_default]
6059
steps:
6160
- name: update_pr_status_success
6261
if: always() && success()
63-
run: |
64-
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 build started2!' -f context='Windows pre-commit'
6562
env:
6663
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6764
OWNER: ${{ github.repository_owner }}
6865
REPO: ${{ github.event.repository.name }}
69-
SHA: ${{ steps.sha.outputs.result }}
66+
SHA: ${{ needs.windows_test_preparation.outputs.PR_SHA }}
67+
run: |
68+
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'
7069
- name: update_pr_status_failure
7170
if: failure()
72-
run: |
73-
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='The build started2!' -f context='Windows pre-commit'
7471
env:
7572
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7673
OWNER: ${{ github.repository_owner }}
7774
REPO: ${{ github.event.repository.name }}
78-
SHA: ${{ steps.sha.outputs.result }}
79-
80-
# windows_default:
81-
# runs-on: ubuntu-latest
82-
# needs: [windows_test_preparation]
83-
# steps:
84-
# - name: print_ref
85-
# run: |
86-
# echo "REF == = = = = = = ${{github.ref}}"
87-
# echo "REF == = = = = = = ${{ needs.windows_test_preparation.outputs.PR_SHA }}"
75+
SHA: ${{ needs.windows_test_preparation.outputs.PR_SHA }}
76+
run: |
77+
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'

0 commit comments

Comments
 (0)