-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (41 loc) · 1.08 KB
/
terraform-test.yaml
File metadata and controls
50 lines (41 loc) · 1.08 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
name: Terraform Tests
on:
pull_request:
paths:
- 'infrastructure/**'
push:
branches:
- main
- fix-alerts-more
paths:
- 'infrastructure/**'
jobs:
terraform-tests:
runs-on: ubuntu-latest
defaults:
run:
working-directory: infrastructure
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: 1.6.0
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install testing tools
run: |
pip install checkov
curl -s https://raw.githubusercontent.com/terraform-linters/tflint/master/install_linux.sh | bash
- name: Make test script executable
run: chmod +x tests/test-terraform.sh
- name: Run tests
run: ./tests/test-terraform.sh
- name: Terraform Plan
run: |
terraform init -backend=false
terraform plan -no-color
continue-on-error: true