Skip to content

Commit 91c9e91

Browse files
authored
Merge pull request #1413 from lukaszstolarczuk/fix-e2e-on-pr
[CI] Fix and extend E2E on PRs
2 parents e2ee9a4 + 51bbfcf commit 91c9e91

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

.github/workflows/e2e_core.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,6 @@ jobs:
6666
ls -la ./
6767
rm -rf ./* || true
6868
69-
- uses: xt0rted/pull-request-comment-branch@d97294d304604fa98a2600a6e2f916a84b596dc7 # v2.0.0
70-
id: comment-branch
71-
if: ${{ always() && inputs.trigger != 'schedule' }}
72-
7369
- name: Add comment to PR
7470
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
7571
if: ${{ always() && inputs.trigger != 'schedule' }}
@@ -90,7 +86,18 @@ jobs:
9086
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
9187
with:
9288
path: ur-repo
93-
ref: ${{ steps.comment-branch.outputs.head_ref }}
89+
90+
# On issue_comment trigger (for PRs) we need to fetch special ref for
91+
# proper PR's merge commit. Note, this ref may be absent if the PR is already merged.
92+
- name: Fetch PR's merge commit
93+
if: ${{ inputs.trigger != 'schedule' }}
94+
working-directory: ${{github.workspace}}/ur-repo
95+
env:
96+
PR_NO: ${{github.event.issue.number}}
97+
run: |
98+
git fetch -- https://github.com/${{github.repository}} +refs/pull/${PR_NO}/*:refs/remotes/origin/pr/${PR_NO}/*
99+
git checkout origin/pr/${PR_NO}/merge
100+
git rev-parse origin/pr/${PR_NO}/merge
94101
95102
- name: Checkout SYCL
96103
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
@@ -191,8 +198,9 @@ jobs:
191198
script: |
192199
const adapter = '${{ matrix.adapter.name }}';
193200
const url = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}';
194-
const status = '${{ steps.tests.outcome }}';
195-
const body = `E2E ${adapter} build: \n${url}\n Status: ${status}`;
201+
const test_status = '${{ steps.tests.outcome }}';
202+
const job_status = '${{ job.status }}';
203+
const body = `E2E ${adapter} build:\n${url}\nJob status: ${job_status}. Test status: ${test_status}`;
196204
197205
github.rest.issues.createComment({
198206
issue_number: context.issue.number,

0 commit comments

Comments
 (0)