-
Notifications
You must be signed in to change notification settings - Fork 629
48 lines (44 loc) · 1.5 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
name: "Terraform checks"
on:
push:
branches:
- main
- npalm/*
pull_request:
paths: ["**/*.tf", "**/*.hcl", "modules/**/*", ".github/workflows/terraform.yml", ".utils/**"]
permissions:
contents: read
pull-requests: write
jobs:
dirs:
name: Find modules
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- id: find
# Ignore directories whose names start with .terraform or obsolete
shell: bash
run: |
source ./.utils/find.sh
#modules=$(findAllTerraformDirs --ignores "examples")
#modules=$(echo $modules | jq 'map(select(. | contains("./modules/multi-runner")))')
#examples=$(findAllTerraformDirs --ignores "modules" --hide-root)
modules=$(findAllTerraformDirs)
echo "modules=$(echo $modules)" >> $GITHUB_OUTPUT
echo "examples=$(echo $examples)" >> $GITHUB_OUTPUT
outputs:
tf_modules: ${{ steps.find.outputs.modules }}
tf_examples: ${{ steps.find.outputs.examples }}
verify:
uses: ./.github/workflows/terraform-validate-template.yml
name: Verify module for Terraform ${{ matrix.terraform }}
needs: dirs
with:
terraform_version: ${{ matrix.terraform }}
module: ${{ matrix.modules }}
tflint-options: ${{ matrix.modules == '.' && '' || '--recursive' }}
strategy:
fail-fast: false
matrix:
modules: [ ".", "modules", "examples"]
terraform: ["1.5", "latest"]