aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/terraform.yml
blob: d28a357051ea955db9b17ed04fb63c990b99dde5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: terraform-quality-checks

on:
    push:
        branches: [development]
        paths:
            - 'terraform/**.tf'
            - 'terraform/**.tfvars'
    pull_request:
        branches: [development, staging]
        paths:
            - 'terraform/**.tf'
            - 'terraform/**.tfvars'
jobs:
    terraform-validation:
        runs-on: ubuntu-latest
        steps:
            - uses: actions/checkout@v2
            - name: Setup Terraform
              uses: hashicorp/setup-terraform@v1
              with:
                  terraform_version: latest # Using the latest version, but not sure if it's the best practice
            - name: Format
              run: terraform fmt -check -recursive
            - name: Init
              run: terraform init -backend=false
            - name: Validate
              run: terraform validate
            - name: Setup TFLint
              uses: terraform-linters/setup-tflint@v2
              with:
                  tflint_version: latest
            - name: Run TFLint
              run: tflint -f compact
git.ajschof.me — hosted by ajschofield — powered by cgit