-
Notifications
You must be signed in to change notification settings - Fork 4
35 lines (33 loc) · 964 Bytes
/
terraform.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
name: Terraform
on:
push:
branches:
- main
pull_request:
jobs:
terraform:
name: Terraform
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
directory: [".", "./example"]
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Terraform
uses: hashicorp/setup-terraform@v1
with:
terraform_version: ">= 0.13"
- name: Init Terraform
run: terraform init
working-directory: ${{ matrix.directory }}
- name: Validate Terraform configurations
run: terraform validate
working-directory: ${{ matrix.directory }}
- name: Validate Terraform configuration files formatting
run: if ! terraform fmt -list=false -check; then echo "Some terraform files need be formatted, run 'terraform fmt' to fix"; exit 1; fi
working-directory: ${{ matrix.directory }}