ci: Updating actions/checkout to v4 and defaulting to fetch-depth 1 instead of 0 (#29281)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Chores**
- Updated GitHub Actions workflows to use `actions/checkout@v4` for
improved performance and reliability.
- Removed `fetch-depth` parameter to simplify checkout steps across
various workflows.
  - Standardized quote usage for consistency in workflow files.

- **Documentation**
- Adjusted formatting and descriptions in workflow files for better
clarity and readability.

- **Refactor**
- Aligned multiple workflow files to follow a consistent structure and
naming convention.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

fetch-depth 0 causes the Github workflow to checkout the entire Git
history. This is not required. We only need to check out the head of the
commit. By default, actions/checkout has fetch-depth=1, hence removing
it from the workflow completely for simplicity.
This commit is contained in:
Arpit Mohan 2023-12-05 13:44:43 +05:30 committed by GitHub
parent 3daa0a04a5
commit 2650ea161d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
33 changed files with 115 additions and 177 deletions

View File

@ -9,12 +9,11 @@ jobs:
if: (github.event.action == 'opened' || github.event.action == 'reopened') && contains( github.event.issue.labels.*.name, 'CI impacted') if: (github.event.action == 'opened' || github.event.action == 'reopened') && contains( github.event.issue.labels.*.name, 'CI impacted')
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
issues: write issues: write
steps: steps:
- name: Checkout the merged commit from PR and base branch - name: Checkout the merged commit from PR and base branch
uses: actions/checkout@v2 uses: actions/checkout@v2
with:
fetch-depth: 0
- name: View issue information - name: View issue information
env: env:
GITHUB_CONTEXT: ${{ toJson(github) }} GITHUB_CONTEXT: ${{ toJson(github) }}
@ -33,12 +32,11 @@ jobs:
if: github.event.action == 'closed' && contains( github.event.issue.labels.*.name, 'CI impacted') if: github.event.action == 'closed' && contains( github.event.issue.labels.*.name, 'CI impacted')
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
issues: write issues: write
steps: steps:
- name: Checkout the merged commit from PR and base branch - name: Checkout the merged commit from PR and base branch
uses: actions/checkout@v2 uses: actions/checkout@v2
with:
fetch-depth: 0
- name: View issue information - name: View issue information
env: env:
GITHUB_CONTEXT: ${{ toJson(github) }} GITHUB_CONTEXT: ${{ toJson(github) }}

View File

@ -62,7 +62,7 @@ jobs:
steps: steps:
# Check out merge commit # Check out merge commit
- name: Checkout Branch - name: Checkout Branch
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
ref: ${{ github.event.inputs.branch }} ref: ${{ github.event.inputs.branch }}
@ -142,7 +142,7 @@ jobs:
if: success() if: success()
steps: steps:
- name: Checkout PR - name: Checkout PR
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
ref: ${{ github.event.inputs.branch }} ref: ${{ github.event.inputs.branch }}
@ -196,5 +196,3 @@ jobs:
--data ' { --data ' {
"status": "FAILED" "status": "FAILED"
}' }'

View File

@ -39,17 +39,14 @@ jobs:
# Check out merge commit with the base branch in case this workflow is invoked via pull request # Check out merge commit with the base branch in case this workflow is invoked via pull request
- name: Checkout the merged commit from PR and base branch - name: Checkout the merged commit from PR and base branch
if: inputs.pr != 0 if: inputs.pr != 0
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
fetch-depth: 0
ref: refs/pull/${{ inputs.pr }}/merge ref: refs/pull/${{ inputs.pr }}/merge
# Checkout the code in the current branch in case the workflow is called because of a branch push event # Checkout the code in the current branch in case the workflow is called because of a branch push event
- name: Checkout the head commit of the branch - name: Checkout the head commit of the branch
if: inputs.pr == 0 if: inputs.pr == 0
uses: actions/checkout@v3 uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Figure out the PR number - name: Figure out the PR number
run: echo ${{ inputs.pr }} run: echo ${{ inputs.pr }}
@ -97,7 +94,6 @@ jobs:
echo "appsmithctl_run_result=failed" >> $GITHUB_OUTPUT > ~/appsmithctl_run_result echo "appsmithctl_run_result=failed" >> $GITHUB_OUTPUT > ~/appsmithctl_run_result
exit 1; exit 1;
# Set status = success # Set status = success
- name: Save the status of the run - name: Save the status of the run
run: echo "appsmithctl_run_result=success" >> $GITHUB_OUTPUT > ~/appsmithctl_run_result run: echo "appsmithctl_run_result=success" >> $GITHUB_OUTPUT > ~/appsmithctl_run_result

View File

@ -1,34 +1,32 @@
name: 'Build Storybook - UI Tests with Chromatic' name: "Build Storybook - UI Tests with Chromatic"
on: on:
push: push:
branches: branches:
- release - release
paths: paths:
- 'app/client/packages/design-system/**' - "app/client/packages/design-system/**"
- 'app/client/packages/storybook/**' - "app/client/packages/storybook/**"
pull_request: pull_request:
paths: paths:
- 'app/client/packages/design-system/**' - "app/client/packages/design-system/**"
- 'app/client/packages/storybook/**' - "app/client/packages/storybook/**"
jobs: jobs:
chromatic-deployment: chromatic-deployment:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout PR if pull_request event - name: Checkout PR if pull_request event
if: github.event_name == 'pull_request' if: github.event_name == 'pull_request'
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
fetch-depth: 0
ref: refs/pull/${{ github.event.pull_request.number }}/merge ref: refs/pull/${{ github.event.pull_request.number }}/merge
- name: Checkout PR if push event - name: Checkout PR if push event
if: github.event_name == 'push' if: github.event_name == 'push'
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
fetch-depth: 0
ref: release ref: release
- name: Use Node.js - name: Use Node.js
@ -39,7 +37,7 @@ jobs:
- name: Install Dependencies - name: Install Dependencies
working-directory: ./app/client/packages/storybook working-directory: ./app/client/packages/storybook
run: yarn install --immutable run: yarn install --immutable
- name: Publish to Chromatic - name: Publish to Chromatic
id: chromatic-publish id: chromatic-publish
uses: chromaui/action@v1 uses: chromaui/action@v1

View File

@ -24,9 +24,7 @@ jobs:
matrix_count: ${{steps.matrix.outputs.matrix_count}} matrix_count: ${{steps.matrix.outputs.matrix_count}}
steps: steps:
- name: Checkout the head commit of the branch - name: Checkout the head commit of the branch
uses: actions/checkout@v3 uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set matrix jobs - name: Set matrix jobs
id: matrix id: matrix

View File

@ -26,17 +26,14 @@ jobs:
# Check out merge commit # Check out merge commit
- name: Fork based /ok-to-test checkout - name: Fork based /ok-to-test checkout
if: inputs.pr != 0 if: inputs.pr != 0
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
fetch-depth: 0
ref: "refs/pull/${{ inputs.pr }}/merge" ref: "refs/pull/${{ inputs.pr }}/merge"
# Checkout the code in the current branch in case the workflow is called because of a branch push event # Checkout the code in the current branch in case the workflow is called because of a branch push event
- name: Checkout the head commit of the branch - name: Checkout the head commit of the branch
if: inputs.pr == 0 if: inputs.pr == 0
uses: actions/checkout@v3 uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download the client build artifact - name: Download the client build artifact
if: steps.run_result.outputs.run_result != 'success' if: steps.run_result.outputs.run_result != 'success'

View File

@ -1,34 +1,32 @@
name: 'Build Storybook - Docs with Chromatic' name: "Build Storybook - Docs with Chromatic"
on: on:
push: push:
branches: branches:
- release - release
paths: paths:
- 'app/client/packages/design-system/**' - "app/client/packages/design-system/**"
- 'app/client/packages/storybook/**' - "app/client/packages/storybook/**"
pull_request: pull_request:
paths: paths:
- 'app/client/packages/design-system/**' - "app/client/packages/design-system/**"
- 'app/client/packages/storybook/**' - "app/client/packages/storybook/**"
jobs: jobs:
chromatic-deployment: chromatic-deployment:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout PR if pull_request event - name: Checkout PR if pull_request event
if: github.event_name == 'pull_request' if: github.event_name == 'pull_request'
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
fetch-depth: 0
ref: refs/pull/${{ github.event.pull_request.number }}/merge ref: refs/pull/${{ github.event.pull_request.number }}/merge
- name: Checkout PR if push event - name: Checkout PR if push event
if: github.event_name == 'push' if: github.event_name == 'push'
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
fetch-depth: 0
ref: release ref: release
- name: Use Node.js - name: Use Node.js
@ -39,7 +37,7 @@ jobs:
- name: Install Dependencies - name: Install Dependencies
working-directory: ./app/client/packages/storybook working-directory: ./app/client/packages/storybook
run: yarn install --immutable run: yarn install --immutable
- name: Publish to Chromatic - name: Publish to Chromatic
id: chromatic-publish id: chromatic-publish
uses: chromaui/action@v1 uses: chromaui/action@v1

View File

@ -5,9 +5,9 @@ on:
workflow_dispatch: workflow_dispatch:
inputs: inputs:
run_id: run_id:
description: 'Run id to download artifacts:' description: "Run id to download artifacts:"
required: true required: true
type: number type: number
jobs: jobs:
ci-debugger: ci-debugger:
@ -19,7 +19,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
job: [ 0 ] job: [0]
# Service containers to run with this job. Required for running tests # Service containers to run with this job. Required for running tests
services: services:
@ -40,9 +40,7 @@ jobs:
uses: depot/setup-action@v1 uses: depot/setup-action@v1
- name: Checkout the head commit of the branch - name: Checkout the head commit of the branch
uses: actions/checkout@v3 uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download Docker image artifact - name: Download Docker image artifact
uses: dawidd6/action-download-artifact@v2 uses: dawidd6/action-download-artifact@v2
@ -82,7 +80,7 @@ jobs:
-e APPSMITH_CLOUD_SERVICES_BASE_URL=http://host.docker.internal:5001 \ -e APPSMITH_CLOUD_SERVICES_BASE_URL=http://host.docker.internal:5001 \
--add-host=host.docker.internal:host-gateway \ --add-host=host.docker.internal:host-gateway \
cicontainer cicontainer
- name: Execute access to ci-debug.sh - name: Execute access to ci-debug.sh
if: steps.run_result.outputs.run_result != 'success' if: steps.run_result.outputs.run_result != 'success'
working-directory: "." working-directory: "."

View File

@ -43,17 +43,14 @@ jobs:
# Check out merge commit # Check out merge commit
- name: Fork based /ok-to-test checkout - name: Fork based /ok-to-test checkout
if: inputs.pr != 0 if: inputs.pr != 0
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
fetch-depth: 0
ref: "refs/pull/${{ inputs.pr }}/merge" ref: "refs/pull/${{ inputs.pr }}/merge"
# Checkout the code in the current branch in case the workflow is called because of a branch push event # Checkout the code in the current branch in case the workflow is called because of a branch push event
- name: Checkout the head commit of the branch - name: Checkout the head commit of the branch
if: inputs.pr == 0 if: inputs.pr == 0
uses: actions/checkout@v3 uses: actions/checkout@v4
with:
fetch-depth: 0
# Timestamp will be used to create cache key # Timestamp will be used to create cache key
- id: timestamp - id: timestamp

View File

@ -43,17 +43,14 @@ jobs:
# Check out merge commit # Check out merge commit
- name: Fork based /ok-to-test checkout - name: Fork based /ok-to-test checkout
if: inputs.pr != 0 if: inputs.pr != 0
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
fetch-depth: 0
ref: "refs/pull/${{ inputs.pr }}/merge" ref: "refs/pull/${{ inputs.pr }}/merge"
# Checkout the code in the current branch in case the workflow is called because of a branch push event # Checkout the code in the current branch in case the workflow is called because of a branch push event
- name: Checkout the head commit of the branch - name: Checkout the head commit of the branch
if: inputs.pr == 0 if: inputs.pr == 0
uses: actions/checkout@v3 uses: actions/checkout@v4
with:
fetch-depth: 0
# Timestamp will be used to create cache key # Timestamp will be used to create cache key
- id: timestamp - id: timestamp

View File

@ -119,17 +119,14 @@ jobs:
# Check out merge commit # Check out merge commit
- name: Fork based /ok-to-test checkout - name: Fork based /ok-to-test checkout
if: inputs.pr != 0 if: inputs.pr != 0
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
fetch-depth: 0
ref: "refs/pull/${{ inputs.pr }}/merge" ref: "refs/pull/${{ inputs.pr }}/merge"
# Checkout the code in the current branch in case the workflow is called because of a branch push event # Checkout the code in the current branch in case the workflow is called because of a branch push event
- name: Checkout the head commit of the branch - name: Checkout the head commit of the branch
if: inputs.pr == 0 if: inputs.pr == 0
uses: actions/checkout@v3 uses: actions/checkout@v4
with:
fetch-depth: 0
# Timestamp will be used to create cache key # Timestamp will be used to create cache key
- id: timestamp - id: timestamp

View File

@ -53,17 +53,14 @@ jobs:
# Check out merge commit # Check out merge commit
- name: Fork based /ok-to-test checkout - name: Fork based /ok-to-test checkout
if: inputs.pr != 0 if: inputs.pr != 0
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
fetch-depth: 0
ref: "refs/pull/${{ inputs.pr }}/merge" ref: "refs/pull/${{ inputs.pr }}/merge"
# Checkout the code in the current branch in case the workflow is called because of a branch push event # Checkout the code in the current branch in case the workflow is called because of a branch push event
- name: Checkout the head commit of the branch - name: Checkout the head commit of the branch
if: inputs.pr == 0 || github.event_name == 'schedule' if: inputs.pr == 0 || github.event_name == 'schedule'
uses: actions/checkout@v3 uses: actions/checkout@v4
with:
fetch-depth: 0
# Timestamp will be used to create cache key # Timestamp will be used to create cache key
- id: timestamp - id: timestamp

View File

@ -80,17 +80,14 @@ jobs:
# Check out merge commit # Check out merge commit
- name: Fork based /ok-to-test checkout - name: Fork based /ok-to-test checkout
if: inputs.pr != 0 if: inputs.pr != 0
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
fetch-depth: 0
ref: "refs/pull/${{ inputs.pr }}/merge" ref: "refs/pull/${{ inputs.pr }}/merge"
# Checkout the code in the current branch in case the workflow is called because of a branch push event # Checkout the code in the current branch in case the workflow is called because of a branch push event
- name: Checkout the head commit of the branch - name: Checkout the head commit of the branch
if: inputs.pr == 0 if: inputs.pr == 0
uses: actions/checkout@v3 uses: actions/checkout@v4
with:
fetch-depth: 0
# Timestamp will be used to create cache key # Timestamp will be used to create cache key
- id: timestamp - id: timestamp

View File

@ -115,17 +115,14 @@ jobs:
# Check out merge commit # Check out merge commit
- name: Fork based /ok-to-test checkout - name: Fork based /ok-to-test checkout
if: inputs.pr != 0 if: inputs.pr != 0
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
fetch-depth: 0
ref: "refs/pull/${{ inputs.pr }}/merge" ref: "refs/pull/${{ inputs.pr }}/merge"
# Checkout the code in the current branch in case the workflow is called because of a branch push event # Checkout the code in the current branch in case the workflow is called because of a branch push event
- name: Checkout the head commit of the branch - name: Checkout the head commit of the branch
if: inputs.pr == 0 if: inputs.pr == 0
uses: actions/checkout@v3 uses: actions/checkout@v4
with:
fetch-depth: 0
# Timestamp will be used to create cache key # Timestamp will be used to create cache key
- id: timestamp - id: timestamp

View File

@ -53,17 +53,14 @@ jobs:
# Check out merge commit # Check out merge commit
- name: Fork based /ok-to-test checkout - name: Fork based /ok-to-test checkout
if: inputs.pr != 0 if: inputs.pr != 0
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
fetch-depth: 0
ref: "refs/pull/${{ inputs.pr }}/merge" ref: "refs/pull/${{ inputs.pr }}/merge"
# Checkout the code in the current branch in case the workflow is called because of a branch push event # Checkout the code in the current branch in case the workflow is called because of a branch push event
- name: Checkout the head commit of the branch - name: Checkout the head commit of the branch
if: inputs.pr == 0 if: inputs.pr == 0
uses: actions/checkout@v3 uses: actions/checkout@v4
with:
fetch-depth: 0
# Timestamp will be used to create cache key # Timestamp will be used to create cache key
- id: timestamp - id: timestamp

View File

@ -11,8 +11,6 @@ jobs:
steps: steps:
# Checkout the code # Checkout the code
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install mongosh - name: Install mongosh
run: | run: |

View File

@ -54,24 +54,24 @@ jobs:
# Check out merge commit with the base branch in case this workflow is invoked via pull request # Check out merge commit with the base branch in case this workflow is invoked via pull request
- name: Checkout the merged commit from PR and base branch - name: Checkout the merged commit from PR and base branch
if: inputs.pr != 0 if: inputs.pr != 0
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-tags: true
ref: refs/pull/${{ inputs.pr }}/merge ref: refs/pull/${{ inputs.pr }}/merge
# Check out the specified branch in case this workflow is called by another workflow # Check out the specified branch in case this workflow is called by another workflow
- name: Checkout the specified branch - name: Checkout the specified branch
if: inputs.pr == 0 && inputs.branch != '' if: inputs.pr == 0 && inputs.branch != ''
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
fetch-tags: true
ref: ${{ inputs.branch }} ref: ${{ inputs.branch }}
# Checkout the code in the current branch in case the workflow is called because of a branch push event # Checkout the code in the current branch in case the workflow is called because of a branch push event
- name: Checkout the head commit of the branch - name: Checkout the head commit of the branch
if: inputs.pr == 0 && inputs.branch == '' if: inputs.pr == 0 && inputs.branch == ''
uses: actions/checkout@v3 uses: actions/checkout@v4
with: fetch-tags: true
fetch-depth: 0
# get all the files changes in the cypress/e2e folder # get all the files changes in the cypress/e2e folder
- name: Get added files in cypress/e2e folder - name: Get added files in cypress/e2e folder

View File

@ -33,9 +33,8 @@ jobs:
# Check out merge commit with the base branch in case this workflow is invoked via pull request # Check out merge commit with the base branch in case this workflow is invoked via pull request
- name: Checkout the merged commit from PR and base branch - name: Checkout the merged commit from PR and base branch
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
fetch-depth: 0
ref: refs/pull/${{ inputs.pr }}/merge ref: refs/pull/${{ inputs.pr }}/merge
# In case this is second attempt try restoring status of the prior attempt from cache # In case this is second attempt try restoring status of the prior attempt from cache

View File

@ -24,7 +24,7 @@ jobs:
steps: steps:
# Check out merge commit with the base branch in case this workflow is invoked via pull request # Check out merge commit with the base branch in case this workflow is invoked via pull request
- name: Checkout the merged commit from PR and base branch - name: Checkout the merged commit from PR and base branch
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
ref: refs/pull/${{ inputs.pr }}/merge ref: refs/pull/${{ inputs.pr }}/merge

View File

@ -33,9 +33,8 @@ jobs:
# Check out merge commit with the base branch in case this workflow is invoked via pull request # Check out merge commit with the base branch in case this workflow is invoked via pull request
- name: Checkout the merged commit from PR and base branch - name: Checkout the merged commit from PR and base branch
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
fetch-depth: 0
ref: refs/pull/${{ inputs.pr }}/merge ref: refs/pull/${{ inputs.pr }}/merge
# In case this is second attempt try restoring status of the prior attempt from cache # In case this is second attempt try restoring status of the prior attempt from cache

View File

@ -22,8 +22,6 @@ jobs:
steps: steps:
- name: Checkout the head commit of the branch - name: Checkout the head commit of the branch
uses: actions/checkout@v4 uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Login to DockerHub - name: Login to DockerHub
uses: docker/login-action@v3 uses: docker/login-action@v3

View File

@ -53,9 +53,7 @@ jobs:
steps: steps:
# Checkout the code # Checkout the code
- uses: actions/checkout@v3 - uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js - name: Use Node.js
uses: actions/setup-node@v3 uses: actions/setup-node@v3
@ -114,15 +112,13 @@ jobs:
steps: steps:
- name: Checkout the code - name: Checkout the code
uses: actions/checkout@v3 uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 17 - name: Set up JDK 17
uses: actions/setup-java@v3 uses: actions/setup-java@v3
with: with:
distribution: 'temurin' distribution: "temurin"
java-version: '17' java-version: "17"
# Retrieve maven dependencies from cache. After a successful run, these dependencies are cached again # Retrieve maven dependencies from cache. After a successful run, these dependencies are cached again
- name: Cache maven dependencies - name: Cache maven dependencies
@ -163,9 +159,7 @@ jobs:
steps: steps:
# Checkout the code # Checkout the code
- uses: actions/checkout@v3 - uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js - name: Use Node.js
uses: actions/setup-node@v3 uses: actions/setup-node@v3
@ -216,7 +210,7 @@ jobs:
steps: steps:
- name: Checkout the merged commit from PR and base branch - name: Checkout the merged commit from PR and base branch
uses: actions/checkout@v3 uses: actions/checkout@v4
- name: Set up Depot CLI - name: Set up Depot CLI
uses: depot/setup-action@v1 uses: depot/setup-action@v1

View File

@ -22,9 +22,7 @@ jobs:
steps: steps:
- name: Checkout the code - name: Checkout the code
uses: actions/checkout@v3 uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Helm - name: Setup Helm
uses: azure/setup-helm@v1 uses: azure/setup-helm@v1

View File

@ -59,7 +59,7 @@ jobs:
steps: steps:
- name: Checkout PR - name: Checkout PR
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
ref: "refs/pull/${{ github.event.client_payload.pull_request.number }}/merge" ref: "refs/pull/${{ github.event.client_payload.pull_request.number }}/merge"
@ -121,7 +121,7 @@ jobs:
steps: steps:
# Check out merge commit # Check out merge commit
- name: Checkout PR - name: Checkout PR
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
ref: "refs/pull/${{ github.event.client_payload.pull_request.number }}/merge" ref: "refs/pull/${{ github.event.client_payload.pull_request.number }}/merge"
@ -201,10 +201,9 @@ jobs:
if: success() if: success()
steps: steps:
- name: Checkout PR - name: Checkout PR
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
ref: "refs/pull/${{ github.event.client_payload.pull_request.number }}/merge" ref: "refs/pull/${{ github.event.client_payload.pull_request.number }}/merge"
fetch-depth: 0
- name: Print versions of tools - name: Print versions of tools
run: | run: |

View File

@ -1,6 +1,4 @@
--- ---
name: Ami Packer Build name: Ami Packer Build
on: on:
@ -9,13 +7,12 @@ on:
jobs: jobs:
packer: packer:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: ami-packer-build name: ami-packer-build
steps: steps:
- name: Checkout Repository - name: Checkout Repository
uses: actions/checkout@v3 uses: actions/checkout@v4
- name: Configure AWS Credentials - name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1 uses: aws-actions/configure-aws-credentials@v1
@ -27,11 +24,11 @@ jobs:
- name: Install python - name: Install python
uses: actions/setup-python@v3 uses: actions/setup-python@v3
with: with:
python-version: '3.8' python-version: "3.8"
- name: Install ansible - name: Install ansible
run: pip install ansible run: pip install ansible
- name: Install Packer - name: Install Packer
run: | run: |
sudo apt-get update; sudo apt-get install -y curl gnupg software-properties-common ; sudo apt-get update; sudo apt-get install -y curl gnupg software-properties-common ;
@ -40,6 +37,6 @@ jobs:
sudo apt-get update && sudo apt-get install -y packer; sudo apt-get update && sudo apt-get install -y packer;
- name: Build artifacts - name: Build artifacts
run : | run: |
cd deploy/packer; cd deploy/packer;
packer build -var vpc_id=${{ secrets.APPSMITH_AWS_VPC_PROD }} -var subnet_id=${{ secrets.APPSMITH_AWS_PROD_SUBNET }} -var token=${{ secrets.DO_TOKEN }} template.json.pkr.hcl packer build -var vpc_id=${{ secrets.APPSMITH_AWS_VPC_PROD }} -var subnet_id=${{ secrets.APPSMITH_AWS_PROD_SUBNET }} -var token=${{ secrets.DO_TOKEN }} template.json.pkr.hcl

View File

@ -43,17 +43,14 @@ jobs:
steps: steps:
- name: Checkout the merged commit from PR and base branch - name: Checkout the merged commit from PR and base branch
if: inputs.pr != 0 if: inputs.pr != 0
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
fetch-depth: 0
ref: refs/pull/${{ inputs.pr }}/merge ref: refs/pull/${{ inputs.pr }}/merge
# Checkout the code in the current branch in case the workflow is called because of a branch push event # Checkout the code in the current branch in case the workflow is called because of a branch push event
- name: Checkout the head commit of the branch - name: Checkout the head commit of the branch
if: inputs.pr == 0 if: inputs.pr == 0
uses: actions/checkout@v3 uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Figure out the PR number - name: Figure out the PR number
run: echo ${{ inputs.pr }} run: echo ${{ inputs.pr }}
@ -115,7 +112,7 @@ jobs:
working-directory: "." working-directory: "."
run: | run: |
mkdir -p cicontainerlocal/stacks/configuration/ mkdir -p cicontainerlocal/stacks/configuration/
- name: Set up SSH key for tunnel - name: Set up SSH key for tunnel
env: env:
SSH_PRIVATE_KEY: ${{ secrets.APPSMITH_CI_TUNNEL_PRIVATE_KEY }} SSH_PRIVATE_KEY: ${{ secrets.APPSMITH_CI_TUNNEL_PRIVATE_KEY }}
@ -126,7 +123,7 @@ jobs:
- name: Setup SSH tunnel to AWS DocumentDB instance - name: Setup SSH tunnel to AWS DocumentDB instance
run: | run: |
ssh -4 -o StrictHostKeyChecking=no -o ServerAliveInterval=180 -o ServerAliveCountMax=5 -i "ssh_key.pem" -L 0.0.0.0:27010:docdb-ansible-test-cluster.cluster-cz8diybf9wdj.ap-south-1.docdb.amazonaws.com:27017 ubuntu@65.1.106.35 -N -f ssh -4 -o StrictHostKeyChecking=no -o ServerAliveInterval=180 -o ServerAliveCountMax=5 -i "ssh_key.pem" -L 0.0.0.0:27010:docdb-ansible-test-cluster.cluster-cz8diybf9wdj.ap-south-1.docdb.amazonaws.com:27017 ubuntu@65.1.106.35 -N -f
- name: Run docker image - name: Run docker image
if: steps.run_result.outputs.run_result != 'success' if: steps.run_result.outputs.run_result != 'success'
env: env:
@ -198,7 +195,7 @@ jobs:
echo ref=$ref >> $GITHUB_OUTPUT echo ref=$ref >> $GITHUB_OUTPUT
- name: Checkout Performance Infra code - name: Checkout Performance Infra code
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
repository: appsmithorg/performance-infra repository: appsmithorg/performance-infra
token: ${{ secrets.APPSMITH_PERF_INFRA_REPO_PAT }} token: ${{ secrets.APPSMITH_PERF_INFRA_REPO_PAT }}

View File

@ -25,11 +25,7 @@ jobs:
github.event_name == 'push' || github.event_name == 'push' ||
github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_dispatch' ||
github.event_name == 'repository_dispatch' github.event_name == 'repository_dispatch'
defaults:
run:
working-directory: app/client
shell: bash
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@ -51,17 +47,14 @@ jobs:
steps: steps:
- name: Checkout the merged commit from PR and base branch - name: Checkout the merged commit from PR and base branch
if: inputs.pr != 0 if: inputs.pr != 0
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
fetch-depth: 0
ref: refs/pull/${{ inputs.pr }}/merge ref: refs/pull/${{ inputs.pr }}/merge
# Checkout the code in the current branch in case the workflow is called because of a branch push event # Checkout the code in the current branch in case the workflow is called because of a branch push event
- name: Checkout the head commit of the branch - name: Checkout the head commit of the branch
if: inputs.pr == 0 if: inputs.pr == 0
uses: actions/checkout@v3 uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Figure out the PR number - name: Figure out the PR number
run: echo ${{ inputs.pr }} run: echo ${{ inputs.pr }}
@ -189,7 +182,7 @@ jobs:
echo ref=$ref >> $GITHUB_OUTPUT echo ref=$ref >> $GITHUB_OUTPUT
- name: Checkout Performance Infra code - name: Checkout Performance Infra code
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
repository: appsmithorg/performance-infra repository: appsmithorg/performance-infra
token: ${{ secrets.APPSMITH_PERF_INFRA_REPO_PAT }} token: ${{ secrets.APPSMITH_PERF_INFRA_REPO_PAT }}

View File

@ -46,17 +46,14 @@ jobs:
steps: steps:
- name: Checkout the merged commit from PR and base branch - name: Checkout the merged commit from PR and base branch
if: inputs.pr != 0 if: inputs.pr != 0
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
fetch-depth: 0
ref: refs/pull/${{ inputs.pr }}/merge ref: refs/pull/${{ inputs.pr }}/merge
# Checkout the code in the current branch in case the workflow is called because of a branch push event # Checkout the code in the current branch in case the workflow is called because of a branch push event
- name: Checkout the head commit of the branch - name: Checkout the head commit of the branch
if: inputs.pr == 0 if: inputs.pr == 0
uses: actions/checkout@v3 uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Figure out the PR number - name: Figure out the PR number
run: echo ${{ inputs.pr }} run: echo ${{ inputs.pr }}
@ -184,7 +181,7 @@ jobs:
echo ref=$ref >> $GITHUB_OUTPUT echo ref=$ref >> $GITHUB_OUTPUT
- name: Checkout Performance Infra code - name: Checkout Performance Infra code
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
repository: appsmithorg/performance-infra repository: appsmithorg/performance-infra
token: ${{ secrets.APPSMITH_PERF_INFRA_REPO_PAT }} token: ${{ secrets.APPSMITH_PERF_INFRA_REPO_PAT }}

View File

@ -13,10 +13,10 @@ jobs:
steps: steps:
# Check out merge commit with the base branch in case this workflow is invoked via pull request # Check out merge commit with the base branch in case this workflow is invoked via pull request
- name: Checkout the merged commit from PR and base branch - name: Checkout the merged commit from PR and base branch
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
ref: refs/pull/${{ github.event.pull_request.number }}/merge ref: refs/pull/${{ github.event.pull_request.number }}/merge
- uses: dorny/paths-filter@v2 - uses: dorny/paths-filter@v2
id: filter id: filter
with: with:
@ -84,7 +84,15 @@ jobs:
qc-result: qc-result:
name: qc-result name: qc-result
needs: [server-spotless, server-unit-tests, client-build, client-prettier, client-unit-tests, client-lint] needs:
[
server-spotless,
server-unit-tests,
client-build,
client-prettier,
client-unit-tests,
client-lint,
]
if: always() if: always()
runs-on: ubuntu-latest runs-on: ubuntu-latest
defaults: defaults:

View File

@ -48,25 +48,25 @@ jobs:
# Check out merge commit with the base branch in case this workflow is invoked via pull request # Check out merge commit with the base branch in case this workflow is invoked via pull request
- name: Checkout the merged commit from PR and base branch - name: Checkout the merged commit from PR and base branch
if: inputs.pr != 0 if: inputs.pr != 0
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-tags: true
ref: refs/pull/${{ inputs.pr }}/merge ref: refs/pull/${{ inputs.pr }}/merge
# Check out the specified branch in case this workflow is called by another workflow # Check out the specified branch in case this workflow is called by another workflow
- name: Checkout the specified branch - name: Checkout the specified branch
if: inputs.pr == 0 && inputs.branch != '' if: inputs.pr == 0 && inputs.branch != ''
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
fetch-tags: true
ref: ${{ inputs.branch }} ref: ${{ inputs.branch }}
# Checkout the code in the current branch in case the workflow is called because of a branch push event # Checkout the code in the current branch in case the workflow is called because of a branch push event
- name: Checkout the head commit of the branch - name: Checkout the head commit of the branch
if: inputs.pr == 0 && inputs.branch == '' if: inputs.pr == 0 && inputs.branch == ''
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-tags: true
- name: Figure out the PR number - name: Figure out the PR number
run: echo ${{ inputs.pr }} run: echo ${{ inputs.pr }}

View File

@ -44,25 +44,26 @@ jobs:
# Check out merge commit with the base branch in case this workflow is invoked via pull request # Check out merge commit with the base branch in case this workflow is invoked via pull request
- name: Check out merged commit from PR and base branch - name: Check out merged commit from PR and base branch
uses: actions/checkout@v3 uses: actions/checkout@v4
if: inputs.pr != 0 if: inputs.pr != 0
with: with:
fetch-depth: 0 fetch-tags: true
ref: refs/pull/${{ inputs.pr }}/merge ref: refs/pull/${{ inputs.pr }}/merge
# Check out the specified branch in case this workflow is called by another workflow # Check out the specified branch in case this workflow is called by another workflow
- name: Checkout the specified branch - name: Checkout the specified branch
if: inputs.pr == 0 && inputs.branch != '' if: inputs.pr == 0 && inputs.branch != ''
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
fetch-tags: true
ref: ${{ inputs.branch }} ref: ${{ inputs.branch }}
# Checkout the code in the current branch in case the workflow is called because of a branch push event # Checkout the code in the current branch in case the workflow is called because of a branch push event
- name: Check out the head commit of the branch - name: Check out the head commit of the branch
uses: actions/checkout@v3 uses: actions/checkout@v4
if: inputs.pr == 0 && inputs.branch == '' if: inputs.pr == 0 && inputs.branch == ''
with: with:
fetch-depth: 0 fetch-tags: true
- name: Figure out the PR number - name: Figure out the PR number
run: echo ${{ inputs.pr }} run: echo ${{ inputs.pr }}
@ -92,8 +93,8 @@ jobs:
if: steps.run_result.outputs.run_result != 'success' if: steps.run_result.outputs.run_result != 'success'
uses: actions/setup-java@v3 uses: actions/setup-java@v3
with: with:
distribution: 'temurin' distribution: "temurin"
java-version: '17' java-version: "17"
# Retrieve maven dependencies from cache. After a successful run, these dependencies are cached again # Retrieve maven dependencies from cache. After a successful run, these dependencies are cached again
- name: Cache maven dependencies - name: Cache maven dependencies

View File

@ -20,7 +20,7 @@ jobs:
steps: steps:
# Check out merge commit with the base branch in case this workflow is invoked via pull request # Check out merge commit with the base branch in case this workflow is invoked via pull request
- name: Checkout the merged commit from PR and base branch - name: Checkout the merged commit from PR and base branch
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
ref: refs/pull/${{ inputs.pr }}/merge ref: refs/pull/${{ inputs.pr }}/merge
@ -28,8 +28,8 @@ jobs:
- name: Set up JDK 17 - name: Set up JDK 17
uses: actions/setup-java@v3 uses: actions/setup-java@v3
with: with:
distribution: 'temurin' distribution: "temurin"
java-version: '17' java-version: "17"
# Run maven step for spotless check # Run maven step for spotless check
- name: Run spotless check - name: Run spotless check

View File

@ -188,7 +188,7 @@ jobs:
steps: steps:
- name: Checkout the head commit of the branch - name: Checkout the head commit of the branch
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
uses: actions/checkout@v3 uses: actions/checkout@v4
- name: Download the react build artifact - name: Download the react build artifact
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
@ -263,7 +263,7 @@ jobs:
steps: steps:
- name: Checkout the head commit of the branch - name: Checkout the head commit of the branch
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
uses: actions/checkout@v3 uses: actions/checkout@v4
- name: Download the react build artifact - name: Download the react build artifact
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3