-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (39 loc) · 1000 Bytes
/
terraform-test.yml
File metadata and controls
46 lines (39 loc) · 1000 Bytes
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
name: Terraform Validation and Testing
on:
push:
branches: [ main, feature/* ]
paths:
- '*.tf'
- '*.tftest.hcl'
- 'modules/**'
- '.tflint.hcl'
- '.pre-commit-config.yaml'
- '.github/workflows/terraform-test.yml'
pull_request:
branches: [ main ]
paths:
- '*.tf'
- '*.tftest.hcl'
- 'modules/**'
- '.tflint.hcl'
- '.pre-commit-config.yaml'
workflow_dispatch:
jobs:
terraform-checks:
name: Terraform Checks & Validation
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup environment
uses: ./.github/actions/setup-nix-shell
with:
prepare_terraform: true
- name: Run pre-commit hooks
run: pre-commit run --all-files --show-diff-on-failure
- name: Terraform Init
run: terraform init -backend=false
- name: Terraform Validate
run: terraform validate