-
Notifications
You must be signed in to change notification settings - Fork 90
50 lines (49 loc) · 1.66 KB
/
pr_iac_lint.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
50
name: Validate IaC
on:
push:
branches:
- v2
pull_request:
branches:
- v2
paths:
- 'examples/**'
jobs:
linter:
runs-on: ubuntu-latest
strategy:
matrix:
project: ["sam", "gradle", "kotlin"]
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Setup java JDK
uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0
with:
distribution: 'corretto'
java-version: 11
- name: Build Project
working-directory: .
run: |
mvn install -DskipTests
- name: Run SAM validator to check syntax of IaC templates - Java
working-directory: examples/powertools-examples-core-utilities//${{ matrix.project }}
run: |
sam build
sam validate --lint
- name: Setup Terraform
uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 #v2.0.3
- name: Run Terraform validator to check syntax of IaC templates and produce a plan of changes
working-directory: examples/powertools-examples-core-utilities/terraform
run: |
mvn install
terraform -version
terraform init -backend=false
terraform validate
- name: Setup Terraform lint
uses: terraform-linters/setup-tflint@a5a1af8c6551fb10c53f1cd4ba62359f1973746f # v3.1.1
- name: Run Terraform lint to check for best practices, errors, deprecated syntax etc.
working-directory: examples/powertools-examples-core-utilities/terraform
run: |
tflint --version
tflint --init
tflint -f compact