-
Notifications
You must be signed in to change notification settings - Fork 6
67 lines (62 loc) · 1.65 KB
/
lint.yml
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
57
58
59
60
61
62
63
64
65
66
67
name: Lint
on: [push]
jobs:
tflint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: TFLint
uses: docker://wata727/tflint
fmt:
name: Code Format
runs-on: ubuntu-latest
container:
image: hashicorp/terraform:latest
steps:
- uses: actions/checkout@master
- run: terraform fmt --recursive -check=true
validate:
name: Validate
runs-on: ubuntu-latest
container:
image: hashicorp/terraform:latest
steps:
- uses: actions/checkout@master
- name: Validate Code
env:
AWS_REGION: 'us-east-1'
TF_WARN_OUTPUT_ERRORS: 1
TF_VAR_vpc_id: 'vpc-123456'
TF_VAR_subnets: '["subnet-12345a"]'
TF_VAR_workers_ami_id: 'ami-123456'
TF_VAR_cluster_name: 'test_cluster'
run: |
terraform init
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
minimum:
name: Minimum version check
runs-on: ubuntu-latest
container:
image: hashicorp/terraform:latest
steps:
- uses: actions/checkout@master
- name: Validate Code
env:
AWS_REGION: 'us-east-1'
TF_WARN_OUTPUT_ERRORS: 1
TF_VAR_vpc_id: 'vpc-123456'
TF_VAR_subnets: '["subnet-12345a"]'
TF_VAR_workers_ami_id: 'ami-123456'
TF_VAR_cluster_name: 'test_cluster'
run: |
terraform init
terraform validate