-
Notifications
You must be signed in to change notification settings - Fork 11
56 lines (46 loc) · 1.21 KB
/
terraform-checks.yaml
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Lint and Validate
on:
pull_request_review:
types: [submitted, edited]
workflow_dispatch:
env:
TF_VERSION: 1.1.7
jobs:
fmt:
runs-on: ubuntu-latest
name: Terraform fmt
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Terraform
uses: hashicorp/setup-terraform@v1
with:
terraform_version: ${{ env.TF_VERSION }}
terraform_wrapper: false
- name: Terraform fmt
run: terraform fmt -check -diff -recursive
validate:
runs-on: ubuntu-latest
name: Terraform Validate
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Terraform
uses: hashicorp/setup-terraform@v1
with:
terraform_version: ${{ env.TF_VERSION }}
terraform_wrapper: false
- name: Terraform init
run: terraform init
- name: Validate Module
env:
AWS_REGION: 'eu-west-1'
run: terraform validate
- name: Validate Examples
run: |
for example in $(find examples -maxdepth 1 -mindepth 1 -type d); do
cd ${example}
terraform init
terraform validate
cd -
done