-
Notifications
You must be signed in to change notification settings - Fork 15
52 lines (43 loc) · 1.09 KB
/
validate.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
name: Terraform validate
permissions:
contents: read
on:
workflow_dispatch:
pull_request:
branches:
- main
- master
jobs:
versionExtract:
name: Extract min/max Terraform versions
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Extract Terraform min/max versions
id: minMax
uses: clowdhaus/terraform-min-max@main
with:
directory: .
outputs:
minVersion: ${{ steps.minMax.outputs.minVersion }}
maxVersion: ${{ steps.minMax.outputs.maxVersion }}
terraform-validate:
runs-on: ubuntu-22.04
needs: versionExtract
strategy:
matrix:
tf_ver:
- ${{ needs.versionExtract.outputs.minVersion }}
- ${{ needs.versionExtract.outputs.maxVersion }}
steps:
- uses: actions/checkout@v3
- uses: hashicorp/setup-terraform@v2
with:
terraform_version: ${{ matrix.tf_ver }}
- name: Terraform Init
id: init
run: terraform init
- name: Terraform Validate
id: validate
run: terraform validate