ci: Upgrading the github action steps from Node 16 to Node 20. (#32004)

## 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"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!IMPORTANT]  
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/8386795331>
> Commit: `2b1bfe7ed505ad9ba67bfe9211d50ebabb8ea0ce`
> Cypress dashboard url: <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8386795331&attempt=1"
target="_blank">Click here!</a>
> All cypress tests have passed 🎉🎉🎉

<!-- end of auto-generated comment: Cypress test results  -->



<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## 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.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Arpit Mohan 2024-04-01 15:41:43 +05:30 committed by GitHub
parent 036f9b0f1b
commit 86cd40982b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 63 additions and 64 deletions

View File

@ -61,7 +61,7 @@ jobs:
uses: depot/setup-action@v1 uses: depot/setup-action@v1
- name: Login to DockerHub - name: Login to DockerHub
uses: docker/login-action@v2 uses: docker/login-action@v3
with: with:
username: ${{ secrets.DOCKER_HUB_USERNAME }} username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

View File

@ -72,7 +72,7 @@ jobs:
uses: depot/setup-action@v1 uses: depot/setup-action@v1
- name: Login to DockerHub - name: Login to DockerHub
uses: docker/login-action@v2 uses: docker/login-action@v3
with: with:
username: ${{ secrets.DOCKER_HUB_USERNAME }} username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

View File

@ -107,7 +107,7 @@ jobs:
uses: depot/setup-action@v1 uses: depot/setup-action@v1
- name: Login to DockerHub - name: Login to DockerHub
uses: docker/login-action@v2 uses: docker/login-action@v3
with: with:
username: ${{ secrets.DOCKER_HUB_USERNAME }} username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

View File

@ -45,7 +45,7 @@ jobs:
uses: depot/setup-action@v1 uses: depot/setup-action@v1
- name: Login to DockerHub - name: Login to DockerHub
uses: docker/login-action@v2 uses: docker/login-action@v3
with: with:
username: ${{ secrets.DOCKER_HUB_USERNAME }} username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

View File

@ -78,7 +78,7 @@ jobs:
id: changed-files-specific id: changed-files-specific
uses: tj-actions/changed-files@v41 uses: tj-actions/changed-files@v41
with: with:
files: 'app/client/**' files: "app/client/**"
- name: Run step if any file(s) in the client folder change - name: Run step if any file(s) in the client folder change
if: steps.changed-files-specific.outputs.any_changed == 'true' if: steps.changed-files-specific.outputs.any_changed == 'true'

View File

@ -113,7 +113,7 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Set up JDK 17 - name: Set up JDK 17
uses: actions/setup-java@v3 uses: actions/setup-java@v4
with: with:
distribution: "temurin" distribution: "temurin"
java-version: "17" java-version: "17"

View File

@ -67,7 +67,6 @@ jobs:
tags: ${{ inputs.tags }} tags: ${{ inputs.tags }}
matrix: ${{ inputs.matrix }} matrix: ${{ inputs.matrix }}
ci-test-result: ci-test-result:
needs: [ci-test] needs: [ci-test]
# Only run if the ci-test with matrices step is successful # 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' if: needs.ci-test.result != 'success' && steps.combine_ci.outputs.specs_failed == '1'
uses: nefrob/pr-description@v1.1.1 uses: nefrob/pr-description@v1.1.1
with: with:
content: | content: |
<!-- This is an auto-generated comment: Cypress test results --> <!-- This is an auto-generated comment: Cypress test results -->
> [!CAUTION] > [!CAUTION]
> Workflow run: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}> > Workflow run: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}>
> Commit: `${{ github.event.pull_request.head.sha }}` > Commit: `${{ github.event.pull_request.head.sha }}`
> Cypress dashboard: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=${{ github.run_id }}&attempt=${{ github.run_attempt }}&selectiontype=test&testsstatus=failed&specsstatus=fail" target="_blank"> Click here!</a> > Cypress dashboard: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=${{ github.run_id }}&attempt=${{ github.run_attempt }}&selectiontype=test&testsstatus=failed&specsstatus=fail" target="_blank"> Click here!</a>
> The following are new failures, please fix them before merging the PR: <ol> > The following are new failures, please fix them before merging the PR: <ol>
${{env.new_failed_spec_env}} </ol> ${{env.new_failed_spec_env}} </ol>
> To know the list of identified flaky tests - <a href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master" target="_blank">Refer here</a> > To know the list of identified flaky tests - <a href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master" target="_blank">Refer here</a>
<!-- end of auto-generated comment: Cypress test results --> <!-- end of auto-generated comment: Cypress test results -->
regex: "<!-- This is an auto-generated comment: Cypress test results -->.*?<!-- end of auto-generated comment: Cypress test results -->" regex: "<!-- This is an auto-generated comment: Cypress test results -->.*?<!-- end of auto-generated comment: Cypress test results -->"
regexFlags: ims regexFlags: ims
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
- name: Modify test response in the PR when ci-test is failed but no specs found - 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' if: needs.ci-test.result != 'success' && steps.combine_ci.outputs.specs_failed == '0'
uses: nefrob/pr-description@v1.1.1 uses: nefrob/pr-description@v1.1.1
with: with:
content: | content: |
<!-- This is an auto-generated comment: Cypress test results --> <!-- This is an auto-generated comment: Cypress test results -->
> [!WARNING] > [!WARNING]
> Workflow run: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}> > Workflow run: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}>
> Commit: `${{ github.event.pull_request.head.sha }}` > Commit: `${{ github.event.pull_request.head.sha }}`
> Cypress dashboard url: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=${{ github.run_id }}&attempt=${{ github.run_attempt }}" target="_blank">Click here!</a> > Cypress dashboard url: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=${{ github.run_id }}&attempt=${{ github.run_attempt }}" target="_blank">Click here!</a>
> It seems like **no tests ran** 😔. We are not able to recognize it, please check workflow <a href="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" target="_blank">here.</a> > It seems like **no tests ran** 😔. We are not able to recognize it, please check workflow <a href="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" target="_blank">here.</a>
<!-- end of auto-generated comment: Cypress test results --> <!-- end of auto-generated comment: Cypress test results -->
regex: "<!-- This is an auto-generated comment: Cypress test results -->.*?<!-- end of auto-generated comment: Cypress test results -->" regex: "<!-- This is an auto-generated comment: Cypress test results -->.*?<!-- end of auto-generated comment: Cypress test results -->"
regexFlags: ims regexFlags: ims
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
- name: Modify test response in the PR when ci-test is success - 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' if: needs.ci-test.result == 'success' && steps.combine_ci.outputs.specs_failed == '0'
uses: nefrob/pr-description@v1.1.1 uses: nefrob/pr-description@v1.1.1
with: with:
content: | content: |
<!-- This is an auto-generated comment: Cypress test results --> <!-- This is an auto-generated comment: Cypress test results -->
> [!IMPORTANT] > [!IMPORTANT]
> Workflow run: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}> > Workflow run: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}>
> Commit: `${{ github.event.pull_request.head.sha }}` > Commit: `${{ github.event.pull_request.head.sha }}`
> Cypress dashboard url: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=${{ github.run_id }}&attempt=${{ github.run_attempt }}" target="_blank">Click here!</a> > Cypress dashboard url: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=${{ github.run_id }}&attempt=${{ github.run_attempt }}" target="_blank">Click here!</a>
> All cypress tests have passed 🎉🎉🎉 > All cypress tests have passed 🎉🎉🎉
<!-- end of auto-generated comment: Cypress test results --> <!-- end of auto-generated comment: Cypress test results -->
regex: "<!-- This is an auto-generated comment: Cypress test results -->.*?<!-- end of auto-generated comment: Cypress test results -->" regex: "<!-- This is an auto-generated comment: Cypress test results -->.*?<!-- end of auto-generated comment: Cypress test results -->"
regexFlags: ims regexFlags: ims
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
- name: Check ci-test set status - name: Check ci-test set status
if: needs.ci-test.result != 'success' if: needs.ci-test.result != 'success'

View File

@ -75,7 +75,7 @@ jobs:
id: changed-files-specific id: changed-files-specific
uses: tj-actions/changed-files@v41 uses: tj-actions/changed-files@v41
with: with:
files: 'app/server/**' files: "app/server/**"
- name: Run step if any file(s) in the server folder change - name: Run step if any file(s) in the server folder change
if: steps.changed-files-specific.outputs.any_changed == 'true' if: steps.changed-files-specific.outputs.any_changed == 'true'
@ -128,7 +128,7 @@ jobs:
# Setup Java # Setup Java
- name: Set up JDK 17 - 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') 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: with:
distribution: "temurin" distribution: "temurin"
java-version: "17" java-version: "17"

View File

@ -26,7 +26,7 @@ jobs:
# Setup Java # Setup Java
- name: Set up JDK 17 - name: Set up JDK 17
uses: actions/setup-java@v3 uses: actions/setup-java@v4
with: with:
distribution: "temurin" distribution: "temurin"
java-version: "17" java-version: "17"

View File

@ -211,27 +211,27 @@ jobs:
- name: Dump GitHub context - name: Dump GitHub context
env: env:
GITHUB_CONTEXT: ${{ toJSON(github) }} GITHUB_CONTEXT: ${{ toJSON(github) }}
run: | run: |
echo "$GITHUB_CONTEXT" echo "$GITHUB_CONTEXT"
echo ${{ github.repository }} echo ${{ github.repository }}
# This step triggers an external workflow for automated analysis of Cypress test runs. # This step triggers an external workflow for automated analysis of Cypress test runs.
- name: Invoke Automated analysis workflow - name: Invoke Automated analysis workflow
run: | run: |
curl --location --request POST ${{secrets.CYPRESS_WORKFLOW_API}} \ curl --location --request POST ${{secrets.CYPRESS_WORKFLOW_API}} \
--header 'x-appsmith-key: ${{ secrets.CYPRESS_WORKFLOW_KEY }}' \ --header 'x-appsmith-key: ${{ secrets.CYPRESS_WORKFLOW_KEY }}' \
--header 'Content-Type: application/json' \ --header 'Content-Type: application/json' \
--data-raw '{ "workflow_id" : ${{ github.run_id }} , --data-raw '{ "workflow_id" : ${{ github.run_id }} ,
"commit_id" : "${{ github.sha }}" , "commit_id" : "${{ github.sha }}" ,
"repo" : "${{ github.event.repository.full_name }}" , "repo" : "${{ github.event.repository.full_name }}" ,
"task" : "${{ github.job }}" , "task" : "${{ github.job }}" ,
"workflow_type" : "${{ github.event_name }}", "workflow_type" : "${{ github.event_name }}",
"workflow_name" : "${{ github.workflow }}", "workflow_name" : "${{ github.workflow }}",
"job_id" : "", "job_id" : "",
"job_data": { "job_data": {
"ci_test_result_sample_data" : "sample_data" "ci_test_result_sample_data" : "sample_data"
} }
}' }'
# Force save the CI failed spec list into a cache # Force save the CI failed spec list into a cache
- name: Store the combined run result for CI - name: Store the combined run result for CI
@ -322,7 +322,7 @@ jobs:
uses: depot/setup-action@v1 uses: depot/setup-action@v1
- name: Login to DockerHub - name: Login to DockerHub
uses: docker/login-action@v2 uses: docker/login-action@v3
with: with:
username: ${{ secrets.DOCKER_HUB_USERNAME }} username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
@ -397,7 +397,7 @@ jobs:
uses: depot/setup-action@v1 uses: depot/setup-action@v1
- name: Login to DockerHub - name: Login to DockerHub
uses: docker/login-action@v2 uses: docker/login-action@v3
with: with:
username: ${{ secrets.DOCKER_HUB_USERNAME }} username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}