Skip to content

Commit

Permalink
added test failure comment
Browse files Browse the repository at this point in the history
  • Loading branch information
aali309 committed Oct 30, 2023
1 parent 4501f4c commit 6a4b2fc
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integrated-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- name: maven-settings
uses: s4u/maven-settings-action@v2
with:
githubServer: false
githubServer: true
- name: ghcr login
uses: redhat-actions/podman-login@v1
with:
Expand Down
46 changes: 39 additions & 7 deletions .github/workflows/pr-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,26 +180,24 @@ jobs:
needs: [checkout-branch, push-to-ghcr]
strategy:
matrix:
arch: [amd64, arm64]
arch: [amd64]
uses: ./.github/workflows/integrated-test.yml
with:
build-arch: ${{ matrix.arch }}
pr-number: ${{ github.event.issue.number }}
sha-value: ${{ needs.checkout-branch.outputs.PR_head_sha }}
skip-itests: ${{ matrix.arch == 'arm64' }}


retest-integration:
needs: [checkout-branch]
if: contains(github.event.comment.body, '/retest')
strategy:
matrix:
arch: [amd64, arm64]
arch: [md64]
uses: ./.github/workflows/integrated-test.yml
with:
build-arch: ${{ matrix.arch }}
pr-number: ${{ github.event.issue.number }}
sha-value: ${{ needs.checkout-branch.outputs.PR_head_sha }}
skip-itests: ${{ matrix.arch == 'arm64' }}

integration-test-pass:
runs-on: ubuntu-latest
Expand All @@ -210,7 +208,7 @@ jobs:
with:
script: |
const runURL = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${{ github.run_id }}`;
const commentBody = `both build and itest completed successfully ✅. \n[View Actions Run](${runURL}).`;
const commentBody = `\`/build_test\` completed successfully ✅. \n[View Actions Run](${runURL}).`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
Expand All @@ -227,7 +225,41 @@ jobs:
with:
script: |
const runURL = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${{ github.run_id }}`;
const commentBody = `retest Integration: All tests pass ✅. \n[View Actions Run](${runURL}).`;
const commentBody = `\`/retest\` Integration: All tests pass ✅. \n[View Actions Run](${runURL}).`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: commentBody
});
comment-integration-test-fail:
if: (always() && contains(needs.*.result, 'failure'))
needs: [integration-test]
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
with:
script: |
const runURL = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${{ github.run_id }}`;
const commentBody = `\`/build_test\` : At least one test failed ❌. \n[View Actions Run](${runURL}).`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: commentBody
});
comment-retest-integration-fail:
if: (always() && contains(needs.*.result, 'failure'))
needs: [retest-integration]
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
with:
script: |
const runURL = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${{ github.run_id }}`;
const commentBody = `\`/retest\` Integration: At least one test failed ❌. \n[View Actions Run](${runURL}).`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
Expand Down

0 comments on commit 6a4b2fc

Please sign in to comment.