From 86cd40982b4dfddc7275ccacf8c080bcf260231a Mon Sep 17 00:00:00 2001 From: Arpit Mohan Date: Mon, 1 Apr 2024 15:41:43 +0530 Subject: [PATCH] ci: Upgrading the github action steps from Node 16 to Node 20. (#32004) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description > [!TIP] > _Add a TL;DR when the description is longer than 500 words or extremely technical (helps the content team)._ > > _Please also include relevant motivation and context. List any dependencies that are required for this change. Add links to Notion, Figma or any other documents that might be relevant to the PR._ This is a maintenance fix that removes the warnings in our CI runs to make it more readable. Refer: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/ > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.Sanity" ### :mag: Cypress test results > [!IMPORTANT] > Workflow run: > Commit: `2b1bfe7ed505ad9ba67bfe9211d50ebabb8ea0ce` > Cypress dashboard url: Click here! > All cypress tests have passed 🎉🎉🎉 ## Summary by CodeRabbit - **Chores** - Updated DockerHub login action across multiple workflows to version 3 for enhanced security and performance. - Updated various GitHub Actions to newer versions in different workflows for improved compatibility and performance. - Modified file path pattern in a workflow step for consistency and clarity. - Updated setup actions for Java to version 4 for better Java environment setup. - Updated setup-node version in a workflow and adjusted comments for Cypress test results. --- .github/workflows/ci-test-custom-script.yml | 2 +- .github/workflows/ci-test-limited.yml | 2 +- .github/workflows/ci-test-with-documentdb.yml | 2 +- .github/workflows/ci-test.yml | 2 +- .github/workflows/client-build.yml | 2 +- .github/workflows/github-release.yml | 2 +- .github/workflows/pr-cypress.yml | 71 +++++++++---------- .github/workflows/server-build.yml | 4 +- .github/workflows/server-spotless.yml | 2 +- .github/workflows/test-build-docker-image.yml | 38 +++++----- 10 files changed, 63 insertions(+), 64 deletions(-) diff --git a/.github/workflows/ci-test-custom-script.yml b/.github/workflows/ci-test-custom-script.yml index 757e5b2ff1..241ac49428 100644 --- a/.github/workflows/ci-test-custom-script.yml +++ b/.github/workflows/ci-test-custom-script.yml @@ -61,7 +61,7 @@ jobs: uses: depot/setup-action@v1 - name: Login to DockerHub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} diff --git a/.github/workflows/ci-test-limited.yml b/.github/workflows/ci-test-limited.yml index b7fe56c0b9..702b6f8018 100644 --- a/.github/workflows/ci-test-limited.yml +++ b/.github/workflows/ci-test-limited.yml @@ -72,7 +72,7 @@ jobs: uses: depot/setup-action@v1 - name: Login to DockerHub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} diff --git a/.github/workflows/ci-test-with-documentdb.yml b/.github/workflows/ci-test-with-documentdb.yml index f05bbcfaff..9080c95494 100644 --- a/.github/workflows/ci-test-with-documentdb.yml +++ b/.github/workflows/ci-test-with-documentdb.yml @@ -107,7 +107,7 @@ jobs: uses: depot/setup-action@v1 - name: Login to DockerHub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} diff --git a/.github/workflows/ci-test.yml b/.github/workflows/ci-test.yml index 2380b5e886..e1d30935ca 100644 --- a/.github/workflows/ci-test.yml +++ b/.github/workflows/ci-test.yml @@ -45,7 +45,7 @@ jobs: uses: depot/setup-action@v1 - name: Login to DockerHub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} diff --git a/.github/workflows/client-build.yml b/.github/workflows/client-build.yml index 81e3dd68f6..90d4d46c43 100644 --- a/.github/workflows/client-build.yml +++ b/.github/workflows/client-build.yml @@ -78,7 +78,7 @@ jobs: id: changed-files-specific uses: tj-actions/changed-files@v41 with: - files: 'app/client/**' + files: "app/client/**" - name: Run step if any file(s) in the client folder change if: steps.changed-files-specific.outputs.any_changed == 'true' diff --git a/.github/workflows/github-release.yml b/.github/workflows/github-release.yml index 2a5f6fc073..f21ae50936 100644 --- a/.github/workflows/github-release.yml +++ b/.github/workflows/github-release.yml @@ -113,7 +113,7 @@ jobs: uses: actions/checkout@v4 - name: Set up JDK 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: "temurin" java-version: "17" diff --git a/.github/workflows/pr-cypress.yml b/.github/workflows/pr-cypress.yml index e49db612b5..1319783fce 100644 --- a/.github/workflows/pr-cypress.yml +++ b/.github/workflows/pr-cypress.yml @@ -67,7 +67,6 @@ jobs: tags: ${{ inputs.tags }} matrix: ${{ inputs.matrix }} - ci-test-result: needs: [ci-test] # Only run if the ci-test with matrices step is successful @@ -177,57 +176,57 @@ jobs: if: needs.ci-test.result != 'success' && steps.combine_ci.outputs.specs_failed == '1' uses: nefrob/pr-description@v1.1.1 with: - content: | - - > [!CAUTION] - > Workflow run: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}> - > Commit: `${{ github.event.pull_request.head.sha }}` - > Cypress dashboard: Click here! - > The following are new failures, please fix them before merging the PR:
    - ${{env.new_failed_spec_env}}
- > To know the list of identified flaky tests - Refer here + content: | + + > [!CAUTION] + > Workflow run: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}> + > Commit: `${{ github.event.pull_request.head.sha }}` + > Cypress dashboard: Click here! + > The following are new failures, please fix them before merging the PR:
    + ${{env.new_failed_spec_env}}
+ > To know the list of identified flaky tests - Refer here - + - regex: ".*?" - regexFlags: ims - token: ${{ secrets.GITHUB_TOKEN }} + regex: ".*?" + regexFlags: ims + token: ${{ secrets.GITHUB_TOKEN }} - name: Modify test response in the PR when ci-test is failed but no specs found if: needs.ci-test.result != 'success' && steps.combine_ci.outputs.specs_failed == '0' uses: nefrob/pr-description@v1.1.1 with: - content: | - - > [!WARNING] - > Workflow run: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}> - > Commit: `${{ github.event.pull_request.head.sha }}` - > Cypress dashboard url: Click here! - > It seems like **no tests ran** 😔. We are not able to recognize it, please check workflow here. + content: | + + > [!WARNING] + > Workflow run: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}> + > Commit: `${{ github.event.pull_request.head.sha }}` + > Cypress dashboard url: Click here! + > It seems like **no tests ran** 😔. We are not able to recognize it, please check workflow here. - + - regex: ".*?" - regexFlags: ims - token: ${{ secrets.GITHUB_TOKEN }} + regex: ".*?" + regexFlags: ims + token: ${{ secrets.GITHUB_TOKEN }} - name: Modify test response in the PR when ci-test is success if: needs.ci-test.result == 'success' && steps.combine_ci.outputs.specs_failed == '0' uses: nefrob/pr-description@v1.1.1 with: - content: | - - > [!IMPORTANT] - > Workflow run: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}> - > Commit: `${{ github.event.pull_request.head.sha }}` - > Cypress dashboard url: Click here! - > All cypress tests have passed 🎉🎉🎉 + content: | + + > [!IMPORTANT] + > Workflow run: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}> + > Commit: `${{ github.event.pull_request.head.sha }}` + > Cypress dashboard url: Click here! + > All cypress tests have passed 🎉🎉🎉 - + - regex: ".*?" - regexFlags: ims - token: ${{ secrets.GITHUB_TOKEN }} + regex: ".*?" + regexFlags: ims + token: ${{ secrets.GITHUB_TOKEN }} - name: Check ci-test set status if: needs.ci-test.result != 'success' diff --git a/.github/workflows/server-build.yml b/.github/workflows/server-build.yml index 66d98fdd4f..d19e288cda 100644 --- a/.github/workflows/server-build.yml +++ b/.github/workflows/server-build.yml @@ -75,7 +75,7 @@ jobs: id: changed-files-specific uses: tj-actions/changed-files@v41 with: - files: 'app/server/**' + files: "app/server/**" - name: Run step if any file(s) in the server folder change if: steps.changed-files-specific.outputs.any_changed == 'true' @@ -128,7 +128,7 @@ jobs: # Setup Java - name: Set up JDK 17 if: steps.run_result.outputs.run_result != 'success' && (steps.changed-files-specific.outputs.any_changed == 'true' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule') - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: "temurin" java-version: "17" diff --git a/.github/workflows/server-spotless.yml b/.github/workflows/server-spotless.yml index 49e1a47a27..c52ad7a437 100644 --- a/.github/workflows/server-spotless.yml +++ b/.github/workflows/server-spotless.yml @@ -26,7 +26,7 @@ jobs: # Setup Java - name: Set up JDK 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: "temurin" java-version: "17" diff --git a/.github/workflows/test-build-docker-image.yml b/.github/workflows/test-build-docker-image.yml index 75a036fb5b..db50ace289 100644 --- a/.github/workflows/test-build-docker-image.yml +++ b/.github/workflows/test-build-docker-image.yml @@ -211,28 +211,28 @@ jobs: - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJSON(github) }} - run: | + run: | echo "$GITHUB_CONTEXT" echo ${{ github.repository }} - + # This step triggers an external workflow for automated analysis of Cypress test runs. - name: Invoke Automated analysis workflow run: | - curl --location --request POST ${{secrets.CYPRESS_WORKFLOW_API}} \ - --header 'x-appsmith-key: ${{ secrets.CYPRESS_WORKFLOW_KEY }}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "workflow_id" : ${{ github.run_id }} , - "commit_id" : "${{ github.sha }}" , - "repo" : "${{ github.event.repository.full_name }}" , - "task" : "${{ github.job }}" , - "workflow_type" : "${{ github.event_name }}", - "workflow_name" : "${{ github.workflow }}", - "job_id" : "", - "job_data": { - "ci_test_result_sample_data" : "sample_data" - } - }' - + curl --location --request POST ${{secrets.CYPRESS_WORKFLOW_API}} \ + --header 'x-appsmith-key: ${{ secrets.CYPRESS_WORKFLOW_KEY }}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ "workflow_id" : ${{ github.run_id }} , + "commit_id" : "${{ github.sha }}" , + "repo" : "${{ github.event.repository.full_name }}" , + "task" : "${{ github.job }}" , + "workflow_type" : "${{ github.event_name }}", + "workflow_name" : "${{ github.workflow }}", + "job_id" : "", + "job_data": { + "ci_test_result_sample_data" : "sample_data" + } + }' + # Force save the CI failed spec list into a cache - name: Store the combined run result for CI if: needs.ci-test.result != 'success' @@ -322,7 +322,7 @@ jobs: uses: depot/setup-action@v1 - name: Login to DockerHub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} @@ -397,7 +397,7 @@ jobs: uses: depot/setup-action@v1 - name: Login to DockerHub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}