-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (49 loc) · 1.41 KB
/
scheduled-test.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
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Scheduled Terraform Test
on:
schedule:
- cron: "0 0 * * *" # Runs every day at midnight UTC
workflow_dispatch: # Allows manual triggering
jobs:
terratest:
name: Run Terratest
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.17'
- name: Install Terraform
uses: hashicorp/setup-terraform@v1
with:
terraform_version: 1.1.5
- name: Install dependencies
run: |
go mod tidy
- name: Run Terratest
run: |
cd test
go test -v
terraform-compliance:
name: Run Terraform Compliance
runs-on: ubuntu-latest
needs: terratest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: 0.13.1
- name: Terraform Init
run: terraform init -backend=false
working-directory: ./example
- name: Terraform Plan
run: terraform plan -out=tfplan -input=false
working-directory: ./example
- name: Install terraform-compliance
run: |
pip install terraform-compliance
- name: Run terraform-compliance
run: terraform-compliance -p ./example/tfplan -f ./compliance/features