Skip to content

Commit

Permalink
add a test for infer deploy action
Browse files Browse the repository at this point in the history
  • Loading branch information
neel-astro committed Sep 18, 2024
1 parent 002d95e commit 10230c1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ jobs:
image_version_after: ${{ steps.get-deployment-after.outputs.desired_image_version }}

infer-image-deploy:
name: Pytest Test
name: Infer Image Deploy Test
runs-on: ubuntu-latest
needs: [pytests-test, create-test-deployments]
strategy:
Expand Down
14 changes: 12 additions & 2 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,13 @@ runs:
echo "Files changed: $files"
dbt_deploy=0
root_folder="${{ inputs.root-folder }}"
if [[ $root_folder == "./" ]]; then
root_folder=""
fi
for file in $files; do
if [[ $file =~ ^"${{ inputs.root-folder }}".* ]]; then
if [[ $file =~ ^"$root_folder".* ]]; then
echo $file is part of configured root folder, so would be triggering a dbt deploy
dbt_deploy=1
fi
Expand Down Expand Up @@ -389,12 +394,17 @@ runs:
skip_deploy=1
root_folder="${{ inputs.root-folder }}"
if [[ $root_folder == "./" ]]; then
root_folder=""
fi
# This for loop checks for following cases:
# 1. If no file is part of the input root folder, then it skips deploy
# 2. If any file is not part of the dags folder, then it triggers a full image build
# 3. If all files are part of the dags folder and input root folder, then it triggers a DAG-only deploy
for file in $files; do
if [[ $file =~ ^"${{ inputs.root-folder }}".* ]]; then
if [[ $file =~ ^"$root_folder".* ]]; then
echo $file is part of the input root folder
skip_deploy=0
if [[ $file != *"dags/"* ]]; then
Expand Down

0 comments on commit 10230c1

Please sign in to comment.