-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (40 loc) · 1.19 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
name: "Code Quality: Terraform"
on:
push:
jobs:
terraform:
name: Terraform
runs-on: ubuntu-latest
strategy:
# see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategyfail-fast
fail-fast: false
matrix:
examples:
- "./examples/basic"
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up Terraform
uses: hashicorp/setup-terraform@v2
with:
terraform_wrapper: false
terraform_version: ${{ secrets.TERRAFORM_VERSION }}
- name: Format Terraform code for Module
run: terraform fmt -check -recursive
env:
working-dir: "./"
- name: Initialize Terraform for Examples
run: terraform init
env:
working-dir: "${{ matrix.examples }}"
- name: Format Terraform code for Examples
run: terraform fmt -check -recursive
env:
working-dir: "${{ matrix.examples }}"
- name: Validate Terraform code for Examples
run: terraform validate
env:
working-dir: "${{ matrix.examples }}"