Skip to content

Commit b6544db

Browse files
authored
add terraform validate to prs (#1444)
1 parent 835bd51 commit b6544db

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

.github/workflows/pr-tests.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Run tests on PRs
22

33
on: [workflow_call]
44

5+
permissions:
6+
contents: read
7+
58
jobs:
69
run-tests:
710
name: Run tests for ${{ matrix.package }}
@@ -46,3 +49,24 @@ jobs:
4649
- name: Run tests
4750
working-directory: ${{ matrix.package }}
4851
run: go test -v ${{ matrix.test_path }}
52+
53+
validate-iac:
54+
name: Validate terraform
55+
runs-on: ubuntu-24.04
56+
steps:
57+
- name: Checkout repository
58+
uses: actions/checkout@v4
59+
60+
- name: Parse .tool-versions
61+
uses: wistia/[email protected]
62+
63+
- name: Setup Terraform
64+
uses: hashicorp/setup-terraform@v3
65+
with:
66+
terraform_version: "${{ env.TERRAFORM }}"
67+
68+
- name: Validate terraform
69+
working-directory: ./iac/provider-gcp
70+
run: |
71+
terraform init -backend=false
72+
terraform validate

0 commit comments

Comments
 (0)