-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from kiraum/kiraum/test_pipeline
feat(pipeline): adding test pipeline
- Loading branch information
Showing
2 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Terraform Lint and Format | ||
|
||
on: | ||
push: | ||
paths: | ||
- '**/*.tf' | ||
- '**/*.tfvars' | ||
pull_request: | ||
paths: | ||
- '**/*.tf' | ||
- '**/*.tfvars' | ||
|
||
jobs: | ||
terraform: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Terraform | ||
uses: hashicorp/setup-terraform@v3 | ||
|
||
- name: Terraform Format | ||
run: terraform fmt -check -recursive | ||
|
||
- name: Terraform Init and Validate | ||
run: | | ||
find ./environments -type f \( -name "*.tf" -o -name "*.tfvars" \) -exec dirname {} \; | sort -u | while read dir; do | ||
cd "$dir" | ||
terraform init -backend=false | ||
terraform validate | ||
cd - | ||
done | ||
- name: Run tflint | ||
uses: terraform-linters/setup-tflint@v4 | ||
|
||
- name: Run tflint | ||
run: | | ||
find ./environments -type f \( -name "*.tf" -o -name "*.tfvars" \) -exec dirname {} \; | sort -u | while read dir; do | ||
cd "$dir" | ||
tflint | ||
cd - | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters