1
1
# This workflow will build and test a golang project
2
2
3
3
name : PR CI
4
- run-name : ' CI pipeline for PR - (#${{ github.event.number }}) ${{ github.event.pull_request.title }}'
4
+ run-name : " CI pipeline for PR - (#${{ github.event.number }}) ${{ github.event.pull_request.title }}"
5
5
6
6
on :
7
7
pull_request :
19
19
- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
20
20
- uses : actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5
21
21
with :
22
- go-version : ' 1.23'
22
+ go-version : " 1.23"
23
23
- name : golangci-lint
24
24
uses : golangci/golangci-lint-action@55c2c1448f86e01eaae002a5a3a9624417608d84 # v6
25
25
with :
34
34
- name : Set up Go
35
35
uses : actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5
36
36
with :
37
- go-version : ' 1.23'
37
+ go-version : " 1.23"
38
38
39
39
- name : Download Go dependencies
40
40
run : go get ./... && go mod tidy
65
65
- name : Set up Go
66
66
uses : actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5
67
67
with :
68
- go-version : ' 1.23'
68
+ go-version : " 1.23"
69
69
70
70
- name : Download Go dependencies
71
71
run : go get ./... && go mod tidy
@@ -90,60 +90,19 @@ jobs:
90
90
91
91
- name : Build provider
92
92
run : |
93
- cd ../generated/ terraform-provider-panos /
93
+ cd target/ terraform/
94
94
go build -o terraform-provider-panos
95
95
mkdir -p ~/.terraform.d/plugins/registry.terraform.io/PaloAltoNetworks/panos/1.0.0/linux_amd64
96
96
mv terraform-provider-panos ~/.terraform.d/plugins/registry.terraform.io/PaloAltoNetworks/panos/1.0.0/linux_amd64
97
97
98
98
- name : Setup Terraform
99
99
uses : hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3
100
100
with :
101
- terraform_version : ' 1.11.2'
101
+ terraform_version : " 1.11.2"
102
102
103
103
- name : Validate Terraform Examples
104
- working-directory : assets/terraform/examples
105
104
run : |
106
- # Create provider configuration template
107
- cat << EOF > provider.tf.template
108
- terraform {
109
- required_providers {
110
- panos = {
111
- source = "PaloAltoNetworks/panos"
112
- version = "1.0.0"
113
- }
114
- }
115
- }
116
-
117
- provider "panos" {
118
- alias = "ci"
119
- }
120
- EOF
121
-
122
- # Find all directories containing .tf files except ephemeral-resources
123
- DIRS=$(find . -type f -name "*.tf" -exec dirname {} \; | sort -u)
124
-
125
- # Loop through each directory and validate
126
- for dir in $DIRS; do
127
-
128
- # Copy provider configuration for validation
129
- cp provider.tf.template $dir/provider.tf
130
-
131
- echo "Validating configurations in : $dir"
132
- cd "$dir"
133
-
134
- # Initialize and validate
135
- terraform init -no-color
136
- terraform validate -no-color
137
-
138
- # Clean up provider configuration
139
- rm provider.tf
140
-
141
- # Return to the examples directory
142
- cd - > /dev/null
143
- done
144
-
145
- # Clean up template
146
- rm provider.tf.template
105
+ ./scripts/validate-terraform-examples.sh
147
106
148
107
- name : Workaround actions/upload-artifact#176
149
108
run : |
0 commit comments