-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (43 loc) · 1.05 KB
/
ci.yml
File metadata and controls
53 lines (43 loc) · 1.05 KB
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
53
name: CI
on:
pull_request:
paths:
- "**.tf"
- "tests/**"
- "schemas/**"
- ".github/workflows/ci.yml"
push:
branches: [main]
paths:
- "**.tf"
- "tests/**"
- "schemas/**"
jobs:
validate:
name: Validate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: hashicorp/setup-terraform@v3
with:
terraform_version_file: .terraform-version
- name: Cache Terraform providers
uses: actions/cache@v4
with:
path: .terraform
key: terraform-${{ hashFiles('.terraform.lock.hcl') }}
restore-keys: terraform-
- name: Format check
run: terraform fmt -check -recursive
- name: Init
run: terraform init -backend=false
- name: Set up tflint
uses: terraform-linters/setup-tflint@v4
with:
tflint_version: latest
- name: Lint
run: |
tflint --init
tflint --recursive
- name: Test (mock providers)
run: terraform test