Skip to content

Commit

Permalink
Merge pull request #14 from dasmeta/DMVP-1972
Browse files Browse the repository at this point in the history
chore(1972): In Terraform-Test reject pipline if not have tests folder in repo and work with every submodule
  • Loading branch information
0katrinpetrosyan0 authored Jan 23, 2023
2 parents bb79eb2 + 2a2b60a commit d35d8e7
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions terraform-test/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Terraform TEST
name: Terraform Test Pipeline
description: "terraform tool common flow action to init, test terraform code"
author: Das Meta
branding:
Expand All @@ -22,7 +22,7 @@ inputs:
path:
description: "Path where to run terraform test"
required: false
default: dashboard
default: /
terraform_version:
description: "Terraform version used in this action"
required: false
Expand All @@ -48,7 +48,16 @@ runs:
with:
terraform_version: ${{ inputs.terraform_version }}

- name: Check for tests folder
run: |
if [ ! -d "${{ inputs.path }}/tests" ]; then
echo "Tests folder not found for ${{ inputs.path }}, exiting pipeline"
exit 1
fi
shell: bash

- name: Run Terraform Test
if: ${{ success() }}
run: |
cd ${{ inputs.path }}
terraform test
Expand Down

0 comments on commit d35d8e7

Please sign in to comment.