-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (44 loc) · 1.27 KB
/
verify.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
name: Verify
on:
push:
branches:
- main
pull_request:
jobs:
## Verify module, terraform validate runs only on examples
verify_module:
name: Verify module
strategy:
matrix:
terraform: [1.0.0]
runs-on: ubuntu-latest
container:
image: hashicorp/terraform:${{ matrix.terraform }}
steps:
- uses: actions/checkout@v2
- name: init terraform
run: terraform init -get -backend=false -input=false
- name: check formatting
run: terraform fmt -recursive -check=true -write=false
verify_examples:
## Verify examples, terraform fmt runs only on module version.
name: Verify examples
strategy:
matrix:
terraform: [1.0.0, latest]
example: ["default"]
defaults:
run:
working-directory: examples/${{ matrix.example }}
runs-on: ubuntu-latest
container:
image: hashicorp/terraform:${{ matrix.terraform }}
steps:
- uses: actions/checkout@v2
- name: init terraform example
run: terraform init -get -backend=false -input=false
- name: check formatting
if: ${{ matrix.terraform == '0.14.5' }}
run: terraform fmt -recursive -check=true -write=false
- name: validate terraform
run: terraform validate