From 60f45fa103a02ebee7ef3c75777361927cc0613d Mon Sep 17 00:00:00 2001 From: Aabishkar KC Date: Thu, 11 Jan 2024 12:07:27 -0500 Subject: [PATCH 1/2] Update smoke tests workflow --- .github/workflows/build_dynamo_all_net8.0.yml | 16 +++++----- .github/workflows/ui_smoke_tests.yml | 31 ++++++++++++++++--- 2 files changed, 36 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build_dynamo_all_net8.0.yml b/.github/workflows/build_dynamo_all_net8.0.yml index 1f3a2b0733c..609a30f3a56 100644 --- a/.github/workflows/build_dynamo_all_net8.0.yml +++ b/.github/workflows/build_dynamo_all_net8.0.yml @@ -46,16 +46,18 @@ jobs: path: ${{ github.workspace }}\Dynamo\bin\AnyCPU\Release if-no-files-found: warn retention-days: 3 - - name: Save Pull Request Artifact - env: - PR_NUMBER: ${{ github.event.number }} + save_pr_data: + name: Save PR Data + runs-on: ubuntu-latest + steps: + - name: Save PR Data run: | - New-Item -Path ${{ github.workspace }}\pr -ItemType Directory -Force - $env:PR_NUMBER | Out-File -FilePath ${{ github.workspace }}\pr\pr_number.txt - - name: Upload Pull Request Artifact + mkdir -p ${{ github.workspace }}/pr + echo ${{ github.event.number }} > ${{ github.workspace }}/pr/pr_number.txt + - name: Upload PR Data uses: actions/upload-artifact@v4 with: name: pr_data - path: ${{ github.workspace }}\pr + path: ${{ github.workspace }}/pr if-no-files-found: warn retention-days: 3 diff --git a/.github/workflows/ui_smoke_tests.yml b/.github/workflows/ui_smoke_tests.yml index c09907edb17..18585185bd9 100644 --- a/.github/workflows/ui_smoke_tests.yml +++ b/.github/workflows/ui_smoke_tests.yml @@ -79,8 +79,9 @@ jobs: }) "@ $run_summary | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append - - name: Add Pull Request Comment + - name: Create Pull Request Comment if: always() + id: create_comment env: GH_TOKEN: ${{ github.token }} run: | @@ -91,6 +92,28 @@ jobs: Workflow Run: [${{ github.workflow }}](${{ format('{0}/{1}/actions/runs/{2}', github.server_url, github.repository, github.run_id) }}) Check: [$env:CHECK_NAME](${{ steps.test_report.outputs.url_html }}) "@ - if ($env:PR_NUMBER) { - gh pr comment $env:PR_NUMBER --body $pr_comment --repo ${{ github.repository }} - } + $pr_comment | Out-File -FilePath $env:GITHUB_OUTPUT -Append + - name: Find Comment + if: env.PR_NUMBER != '' + uses: peter-evans/find-comment@v2 + id: find_comment + with: + issue-number: ${{ env.PR_NUMBER }} + comment-author: github-actions[bot] + body-includes: UI Smoke Tests + direction: last + - name: Create comment + if: env.PR_NUMBER != '' + uses: peter-evans/create-or-update-comment@v3 + with: + issue-number: ${{ env.PR_NUMBER }} + body: | + ${{ steps.create_comment.outputs.pr_comment }} + - name: Update comment + if: env.PR_NUMBER != '' + uses: peter-evans/create-or-update-comment@v3 + with: + comment-id: ${{ steps.find_comment.outputs.comment-id }} + edit-mode: replace + body: | + ${{ steps.create_comment.outputs.pr_comment }} From 72f77a0cb3f53ac513294b1af05b396a4489eeca Mon Sep 17 00:00:00 2001 From: Aabishkar KC Date: Wed, 17 Jan 2024 13:44:41 -0500 Subject: [PATCH 2/2] Update smoke tests workflow --- .github/workflows/ui_smoke_tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ui_smoke_tests.yml b/.github/workflows/ui_smoke_tests.yml index 18585185bd9..a4c619e9e86 100644 --- a/.github/workflows/ui_smoke_tests.yml +++ b/.github/workflows/ui_smoke_tests.yml @@ -103,14 +103,14 @@ jobs: body-includes: UI Smoke Tests direction: last - name: Create comment - if: env.PR_NUMBER != '' + if: env.PR_NUMBER != '' && steps.find_comment.outputs.comment-id == '' uses: peter-evans/create-or-update-comment@v3 with: issue-number: ${{ env.PR_NUMBER }} body: | ${{ steps.create_comment.outputs.pr_comment }} - name: Update comment - if: env.PR_NUMBER != '' + if: env.PR_NUMBER != '' && steps.find_comment.outputs.comment-id != '' uses: peter-evans/create-or-update-comment@v3 with: comment-id: ${{ steps.find_comment.outputs.comment-id }}