Skip to content

Commit

Permalink
ci: add ts check in ci-test-limited (appsmithorg#25137)
Browse files Browse the repository at this point in the history
## Description
- Added ts file check in limited workflow

#### Type of change
- Workflow file
## Testing
>
#### How Has This Been Tested?
- Workflow run
  • Loading branch information
sarojsarab authored Jul 5, 2023
1 parent 499de5a commit 026dacc
Showing 1 changed file with 48 additions and 4 deletions.
52 changes: 48 additions & 4 deletions .github/workflows/build-client-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,50 @@ on:
default: "0"

jobs:
file-check:
runs-on: ubuntu-latest
# Set job outputs to values from filter step
outputs:
non_ts_files: ${{ steps.check_files.outputs.non_ts_files }}
non_ts_files_count: ${{ steps.check_files.outputs.non_ts_files_count }}
steps:
- name: Checkout the head commit of the branch
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Get the diff from base branch
continue-on-error: true
id: files
run: |
git fetch origin release
git diff --name-only --diff-filter=A remotes/origin/release...${{ github.ref_name }} -- 'app/client/cypress/e2e' > diff
echo "files_added=$(cat diff)" >> $GITHUB_OUTPUT
cat diff
- name: Check the newly added files are written in ts
id: check_files
run: |
files=(${{steps.files.outputs.files_added}})
non_ts_files=()
for file in "${files[@]}"; do
if [[ $file != *.ts ]]; then
non_ts_files+=("$file")
fi
done
echo "non_ts_files=${non_ts_files[@]}" >> $GITHUB_OUTPUT
echo "non_ts_files_count=${#non_ts_files[@]}" >> $GITHUB_OUTPUT
- name: Print the files
if: steps.check_files.outputs.non_ts_files_count != 0
run: |
echo "${{ steps.check_files.outputs.non_ts_files }}"
exit 1
server-build:
name: server-build
if: inputs.previous_run_id == '0'
needs: [file-check]
if: success() && inputs.previous_run_id == '0'
uses: ./.github/workflows/server-build.yml
secrets: inherit
with:
Expand All @@ -22,7 +63,8 @@ jobs:

client-build:
name: client-build
if: inputs.previous_run_id == '0'
needs: [file-check]
if: success() && inputs.previous_run_id == '0'
uses: ./.github/workflows/client-build.yml
secrets: inherit
with:
Expand All @@ -31,7 +73,8 @@ jobs:

rts-build:
name: rts-build
if: inputs.previous_run_id == '0'
needs: [file-check]
if: success() && inputs.previous_run_id == '0'
uses: ./.github/workflows/rts-build.yml
secrets: inherit
with:
Expand All @@ -58,8 +101,9 @@ jobs:
pr: 0

ci-test-limited-existing-docker-image:
needs: [file-check]
# Only run if the previous run-id is provided
if: inputs.previous_run_id != '0'
if: success() && inputs.previous_run_id != '0'
name: ci-test-limited-existing-image
uses: ./.github/workflows/ci-test-limited.yml
secrets: inherit
Expand Down

0 comments on commit 026dacc

Please sign in to comment.