Skip to content

Commit

Permalink
Merge pull request #5 from kiraum/kiraum/test_pipeline
Browse files Browse the repository at this point in the history
feat(pipeline): adding test pipeline
  • Loading branch information
kiraum authored Sep 28, 2024
2 parents 1cf52f9 + 3b9adad commit 8738868
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
43 changes: 43 additions & 0 deletions .github/workflows/terraform-lint-format.yml
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
2 changes: 1 addition & 1 deletion environments/prod/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ module "route53" {
{
name = "www"
type = "CNAME"
ttl = 300
ttl = 301
records = ["dpop20p5u4112.cloudfront.net"]
}
]
Expand Down

0 comments on commit 8738868

Please sign in to comment.