From 10615683522f7d324ffd4b07a9fd11eea652fa26 Mon Sep 17 00:00:00 2001 From: Tim Yao <31641325+tim-yao@users.noreply.github.com> Date: Thu, 6 Jun 2024 11:35:58 +1000 Subject: [PATCH 1/6] [SDPTA-106] Fix actions warnings --- .github/actions/test-report/action.yml | 4 ++-- .github/workflows/api.yml | 4 ++-- .github/workflows/build_unit-test.yml | 6 +++--- .github/workflows/notify_slack.yml | 6 +++--- .github/workflows/run_e2e_be.yml | 7 ++----- .github/workflows/run_e2e_fe.yml | 5 +---- .github/workflows/tf_diffscheck.yml | 2 +- .github/workflows/tide_build.yml | 2 +- 8 files changed, 15 insertions(+), 21 deletions(-) diff --git a/.github/actions/test-report/action.yml b/.github/actions/test-report/action.yml index 4be28dfc..4e88ed2a 100644 --- a/.github/actions/test-report/action.yml +++ b/.github/actions/test-report/action.yml @@ -9,13 +9,13 @@ runs: using: 'composite' steps: - name: Archive artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: always() with: name: ${{ inputs.report_name }} path: reports - name: Publish Test Report - uses: mikepenz/action-junit-report@v3 + uses: mikepenz/action-junit-report@v4 if: always() with: report_paths: '/app/reports/report.xml' diff --git a/.github/workflows/api.yml b/.github/workflows/api.yml index c02f234f..a0286245 100644 --- a/.github/workflows/api.yml +++ b/.github/workflows/api.yml @@ -75,13 +75,13 @@ jobs: echo "==> No Postman API test collection is found. Skip the test." fi - name: Upload core API test report - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: always() with: name: core-test-report path: /app/report/tide.collection.report.html - name: Upload custom API test report - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: always() with: name: custom-test-report diff --git a/.github/workflows/build_unit-test.yml b/.github/workflows/build_unit-test.yml index 5689955b..2ee420c3 100644 --- a/.github/workflows/build_unit-test.yml +++ b/.github/workflows/build_unit-test.yml @@ -52,7 +52,7 @@ jobs: run: tar -czf build-artifacts.tar.gz .nuxt - name: Archive build artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: build-artifacts path: build-artifacts.tar.gz @@ -71,7 +71,7 @@ jobs: uses: actions/checkout@v2 - name: Download build artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build-artifacts @@ -99,7 +99,7 @@ jobs: JEST_JUNIT_OUTPUT_DIR: test-results/unit/ - name: Upload test results - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: test-results path: test-results \ No newline at end of file diff --git a/.github/workflows/notify_slack.yml b/.github/workflows/notify_slack.yml index 19af1d25..1217aadc 100644 --- a/.github/workflows/notify_slack.yml +++ b/.github/workflows/notify_slack.yml @@ -52,7 +52,7 @@ jobs: with: JOB_ID: ${{ inputs.workflow_id }} REUSABLE_WORKFLOW_NAME: ${{ inputs.workflow_reusable_name }} - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: ${{ inputs.artifact_name }} - name: prepare-report @@ -83,7 +83,7 @@ jobs: echo "REPORT_TEXT=:crying_cat_face: No report found. Testing may have been skipped." >> $GITHUB_ENV fi - name: sdp-test-report-success - uses: slackapi/slack-github-action@v1.24.0 + uses: slackapi/slack-github-action@v1.26.0 if: env.WORKFLOW_CONCLUSION == 'success' env: REPO_NAME: ${{ github.repository }} @@ -126,7 +126,7 @@ jobs: ] } - name: sdp-test-report-fail - uses: slackapi/slack-github-action@v1.24.0 + uses: slackapi/slack-github-action@v1.26.0 if: env.WORKFLOW_CONCLUSION != 'success' with: channel-id: ${{ inputs.slack_channel }} diff --git a/.github/workflows/run_e2e_be.yml b/.github/workflows/run_e2e_be.yml index 8746534e..dc6ec521 100644 --- a/.github/workflows/run_e2e_be.yml +++ b/.github/workflows/run_e2e_be.yml @@ -112,9 +112,6 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - - name: Get repo name - id: repo_name - run: echo "::set-output name=REPO_NAME::$(echo ${GITHUB_REPOSITORY#*/})" - name: Check browsers run: | @@ -153,7 +150,7 @@ jobs: report_name: 'test-reports-${{ inputs.name }}' - name: Upload test results - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: always() with: name: test-results @@ -172,7 +169,7 @@ jobs: TEST_STATUS=pass node -r ts-node/register -r tsconfig-paths/register scripts/addTestResult.ts - name: Store Cucumber Cloud test report URL - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: always() with: name: ${{ inputs.name }}-report-url diff --git a/.github/workflows/run_e2e_fe.yml b/.github/workflows/run_e2e_fe.yml index 54af2239..4039cbef 100644 --- a/.github/workflows/run_e2e_fe.yml +++ b/.github/workflows/run_e2e_fe.yml @@ -118,9 +118,6 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - - name: Get repo name - id: repo_name - run: echo "::set-output name=REPO_NAME::$(echo ${GITHUB_REPOSITORY#*/})" - name: Check browsers run: | @@ -164,7 +161,7 @@ jobs: report_name: 'test-reports-${{ inputs.name }}' - name: Store Cucumber Cloud test report URL - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: always() with: name: ${{ inputs.name }}-report-url diff --git a/.github/workflows/tf_diffscheck.yml b/.github/workflows/tf_diffscheck.yml index 8b0a533d..d4e9314c 100644 --- a/.github/workflows/tf_diffscheck.yml +++ b/.github/workflows/tf_diffscheck.yml @@ -56,7 +56,7 @@ jobs: - name: Send Slack notification id: notify_slack - uses: slackapi/slack-github-action@v1.24.0 + uses: slackapi/slack-github-action@v1.26.0 if: steps.plan.outputs.exitcode == 2 env: REPO_NAME: ${{ github.repository }} diff --git a/.github/workflows/tide_build.yml b/.github/workflows/tide_build.yml index 407b6dc0..4238a267 100644 --- a/.github/workflows/tide_build.yml +++ b/.github/workflows/tide_build.yml @@ -57,7 +57,7 @@ jobs: run: | /app/.circleci/test-artifacts.sh - name: Upload test results - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: always() with: name: behat-results From b1d16a5c9b5751fa90561e496bca622ba28168ce Mon Sep 17 00:00:00 2001 From: Tim Yao <31641325+tim-yao@users.noreply.github.com> Date: Thu, 6 Jun 2024 13:57:22 +1000 Subject: [PATCH 2/6] Change version for test --- .github/workflows/notify_slack.yml | 2 +- .github/workflows/run_e2e_be.yml | 2 +- .github/workflows/run_e2e_fe.yml | 2 +- .github/workflows/set_status.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/notify_slack.yml b/.github/workflows/notify_slack.yml index 1217aadc..2cc8d3c1 100644 --- a/.github/workflows/notify_slack.yml +++ b/.github/workflows/notify_slack.yml @@ -48,7 +48,7 @@ jobs: steps: - name: Wait 15s for previous jobs to conclude run: sleep 15 - - uses: dpc-sdp/workflow-conclusion-action@main + - uses: dpc-sdp/workflow-conclusion-action@sdpta-1067-node-version-warning with: JOB_ID: ${{ inputs.workflow_id }} REUSABLE_WORKFLOW_NAME: ${{ inputs.workflow_reusable_name }} diff --git a/.github/workflows/run_e2e_be.yml b/.github/workflows/run_e2e_be.yml index dc6ec521..54b7b57f 100644 --- a/.github/workflows/run_e2e_be.yml +++ b/.github/workflows/run_e2e_be.yml @@ -145,7 +145,7 @@ jobs: - name: Report test results if: always() - uses: dpc-sdp/github-actions/.github/actions/test-report@main + uses: dpc-sdp/github-actions/.github/actions/test-report@sdpta-1067-node-version-warning with: report_name: 'test-reports-${{ inputs.name }}' - diff --git a/.github/workflows/run_e2e_fe.yml b/.github/workflows/run_e2e_fe.yml index 4039cbef..746973a5 100644 --- a/.github/workflows/run_e2e_fe.yml +++ b/.github/workflows/run_e2e_fe.yml @@ -156,7 +156,7 @@ jobs: - name: Report test results if: always() - uses: dpc-sdp/github-actions/.github/actions/test-report@main + uses: dpc-sdp/github-actions/.github/actions/test-report@sdpta-1067-node-version-warning with: report_name: 'test-reports-${{ inputs.name }}' - diff --git a/.github/workflows/set_status.yml b/.github/workflows/set_status.yml index 96e09ece..36826249 100644 --- a/.github/workflows/set_status.yml +++ b/.github/workflows/set_status.yml @@ -27,7 +27,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Determine workflow state if not explicitly provided - uses: dpc-sdp/workflow-conclusion-action@main + uses: dpc-sdp/workflow-conclusion-action@sdpta-1067-node-version-warning if: ${{ inputs.state == '' }} - name: Set explicitly provided workflow state if: ${{ inputs.state != '' }} From f4ea68ece2ac1d22418969f8e6116f0fad99a804 Mon Sep 17 00:00:00 2001 From: Tim Yao <31641325+tim-yao@users.noreply.github.com> Date: Thu, 6 Jun 2024 14:28:45 +1000 Subject: [PATCH 3/6] use main for work conclusion --- .github/workflows/notify_slack.yml | 2 +- .github/workflows/set_status.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/notify_slack.yml b/.github/workflows/notify_slack.yml index 2cc8d3c1..1217aadc 100644 --- a/.github/workflows/notify_slack.yml +++ b/.github/workflows/notify_slack.yml @@ -48,7 +48,7 @@ jobs: steps: - name: Wait 15s for previous jobs to conclude run: sleep 15 - - uses: dpc-sdp/workflow-conclusion-action@sdpta-1067-node-version-warning + - uses: dpc-sdp/workflow-conclusion-action@main with: JOB_ID: ${{ inputs.workflow_id }} REUSABLE_WORKFLOW_NAME: ${{ inputs.workflow_reusable_name }} diff --git a/.github/workflows/set_status.yml b/.github/workflows/set_status.yml index 36826249..96e09ece 100644 --- a/.github/workflows/set_status.yml +++ b/.github/workflows/set_status.yml @@ -27,7 +27,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Determine workflow state if not explicitly provided - uses: dpc-sdp/workflow-conclusion-action@sdpta-1067-node-version-warning + uses: dpc-sdp/workflow-conclusion-action@main if: ${{ inputs.state == '' }} - name: Set explicitly provided workflow state if: ${{ inputs.state != '' }} From 0d2afb9fbfcfef1eeb8fe049366638d5a4e845a6 Mon Sep 17 00:00:00 2001 From: Tim Yao <31641325+tim-yao@users.noreply.github.com> Date: Thu, 6 Jun 2024 14:58:59 +1000 Subject: [PATCH 4/6] fix-artifacts --- .github/workflows/run_e2e_be.yml | 2 +- .github/workflows/run_e2e_fe.yml | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run_e2e_be.yml b/.github/workflows/run_e2e_be.yml index 54b7b57f..f6584001 100644 --- a/.github/workflows/run_e2e_be.yml +++ b/.github/workflows/run_e2e_be.yml @@ -153,7 +153,7 @@ jobs: uses: actions/upload-artifact@v4 if: always() with: - name: test-results + name: test-results-${{ inputs.name }} path: /app/reports/ - name: 'Add failed test result status to CMS' diff --git a/.github/workflows/run_e2e_fe.yml b/.github/workflows/run_e2e_fe.yml index 746973a5..8c05b5fe 100644 --- a/.github/workflows/run_e2e_fe.yml +++ b/.github/workflows/run_e2e_fe.yml @@ -159,6 +159,13 @@ jobs: uses: dpc-sdp/github-actions/.github/actions/test-report@sdpta-1067-node-version-warning with: report_name: 'test-reports-${{ inputs.name }}' + - + name: Upload test results + uses: actions/upload-artifact@v4 + if: always() + with: + name: test-results-${{ inputs.name }} + path: /app/reports/ - name: Store Cucumber Cloud test report URL uses: actions/upload-artifact@v4 From fe9325e3a9cb37b625b86e10d59ea890e3770aec Mon Sep 17 00:00:00 2001 From: Tim Yao <31641325+tim-yao@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:22:50 +1000 Subject: [PATCH 5/6] Remove redundant steps --- .github/actions/test-report/action.yml | 2 +- .github/workflows/run_e2e_be.yml | 16 +--------------- .github/workflows/run_e2e_fe.yml | 16 +--------------- 3 files changed, 3 insertions(+), 31 deletions(-) diff --git a/.github/actions/test-report/action.yml b/.github/actions/test-report/action.yml index 4e88ed2a..a617c09d 100644 --- a/.github/actions/test-report/action.yml +++ b/.github/actions/test-report/action.yml @@ -13,7 +13,7 @@ runs: if: always() with: name: ${{ inputs.report_name }} - path: reports + path: /app/reports/ - name: Publish Test Report uses: mikepenz/action-junit-report@v4 if: always() diff --git a/.github/workflows/run_e2e_be.yml b/.github/workflows/run_e2e_be.yml index f6584001..535ff189 100644 --- a/.github/workflows/run_e2e_be.yml +++ b/.github/workflows/run_e2e_be.yml @@ -148,13 +148,6 @@ jobs: uses: dpc-sdp/github-actions/.github/actions/test-report@sdpta-1067-node-version-warning with: report_name: 'test-reports-${{ inputs.name }}' - - - name: Upload test results - uses: actions/upload-artifact@v4 - if: always() - with: - name: test-results-${{ inputs.name }} - path: /app/reports/ - name: 'Add failed test result status to CMS' if: inputs.test_status && failure() @@ -167,13 +160,6 @@ jobs: run: | cd /app TEST_STATUS=pass node -r ts-node/register -r tsconfig-paths/register scripts/addTestResult.ts - - - name: Store Cucumber Cloud test report URL - uses: actions/upload-artifact@v4 - if: always() - with: - name: ${{ inputs.name }}-report-url - path: /app/reports/report-url.txt notify_slack: uses: ./.github/workflows/notify_slack.yml if: | @@ -193,7 +179,7 @@ jobs: workflow_reusable_name: "run_e2e_be" test_type: ${{ inputs.test_type }} test_subtype: ${{ inputs.test_subtype }} - artifact_name: "${{ inputs.name }}-report-url" + artifact_name: "test-reports-${{ inputs.name }}" be_url: ${{ inputs.be_url }} project: ${{ inputs.project }} slack_channel: ${{ inputs.slack_channel }} diff --git a/.github/workflows/run_e2e_fe.yml b/.github/workflows/run_e2e_fe.yml index 8c05b5fe..4c98968b 100644 --- a/.github/workflows/run_e2e_fe.yml +++ b/.github/workflows/run_e2e_fe.yml @@ -159,20 +159,6 @@ jobs: uses: dpc-sdp/github-actions/.github/actions/test-report@sdpta-1067-node-version-warning with: report_name: 'test-reports-${{ inputs.name }}' - - - name: Upload test results - uses: actions/upload-artifact@v4 - if: always() - with: - name: test-results-${{ inputs.name }} - path: /app/reports/ - - - name: Store Cucumber Cloud test report URL - uses: actions/upload-artifact@v4 - if: always() - with: - name: ${{ inputs.name }}-report-url - path: /app/reports/report-url.txt notify_slack: uses: ./.github/workflows/notify_slack.yml if: | @@ -192,7 +178,7 @@ jobs: workflow_reusable_name: "run_e2e_fe" test_type: ${{ inputs.test_type }} test_subtype: ${{ inputs.test_subtype }} - artifact_name: "${{ inputs.name }}-report-url" + artifact_name: "test-reports-${{ inputs.name }}" fe_url: ${{ inputs.fe_url }} be_url: ${{ inputs.be_url }} project: ${{ inputs.project }} From cdf0cbdc9daeea22b1ba7491adaa33824bd406b7 Mon Sep 17 00:00:00 2001 From: Tim Yao <31641325+tim-yao@users.noreply.github.com> Date: Thu, 6 Jun 2024 16:13:44 +1000 Subject: [PATCH 6/6] revert the test changes --- .github/workflows/run_e2e_be.yml | 2 +- .github/workflows/run_e2e_fe.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run_e2e_be.yml b/.github/workflows/run_e2e_be.yml index 535ff189..afe776d7 100644 --- a/.github/workflows/run_e2e_be.yml +++ b/.github/workflows/run_e2e_be.yml @@ -145,7 +145,7 @@ jobs: - name: Report test results if: always() - uses: dpc-sdp/github-actions/.github/actions/test-report@sdpta-1067-node-version-warning + uses: dpc-sdp/github-actions/.github/actions/test-report@main with: report_name: 'test-reports-${{ inputs.name }}' - diff --git a/.github/workflows/run_e2e_fe.yml b/.github/workflows/run_e2e_fe.yml index 4c98968b..476822b5 100644 --- a/.github/workflows/run_e2e_fe.yml +++ b/.github/workflows/run_e2e_fe.yml @@ -156,7 +156,7 @@ jobs: - name: Report test results if: always() - uses: dpc-sdp/github-actions/.github/actions/test-report@sdpta-1067-node-version-warning + uses: dpc-sdp/github-actions/.github/actions/test-report@main with: report_name: 'test-reports-${{ inputs.name }}' notify_slack: