@@ -33,21 +33,103 @@ jobs:
33
33
uses : hashicorp/setup-terraform@v3
34
34
- name : write Terraform configuration
35
35
run : |
36
- cat > main.tf <<EOF
37
- terraform {
38
- required_providers {
39
- cloudflare = {
40
- source = "cloudflare/cloudflare"
41
- version = "~> 4"
42
- }
36
+ cat > main.tf <<EOF
37
+ terraform {
38
+ required_providers {
39
+ cloudflare = {
40
+ source = "cloudflare/cloudflare"
41
+ version = "~> 4"
43
42
}
44
43
}
45
- EOF
44
+ }
45
+ EOF
46
46
- name : terraform init
47
47
run : terraform init
48
48
- name : go test
49
49
env :
50
- CLOUDFLARE_EMAIL :
[email protected]
51
- CLOUDFLARE_API_KEY : aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
52
- CLOUDFLARE_TERRAFORM_INSTALL_PATH : ${{ github.workspace }}
53
- run : make test
50
+ CLOUDFLARE_EMAIL :
[email protected]
51
+ CLOUDFLARE_API_KEY : aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
52
+ CLOUDFLARE_TERRAFORM_INSTALL_PATH : ${{ github.workspace }}
53
+ run : TESTARGS="-run=V4" make test
54
+
55
+ test-v5-generate :
56
+ name : Go + Terraform v5 (Generate)
57
+ runs-on : ubuntu-latest
58
+ steps :
59
+ - name : checkout
60
+ uses : actions/checkout@v4
61
+ with :
62
+ fetch-depth : 0
63
+ - name : install go
64
+ uses : actions/setup-go@v5
65
+ with :
66
+ go-version-file : ' go.mod'
67
+ - uses : actions/cache@v4
68
+ with :
69
+ path : ~/go/pkg/mod
70
+ key : go1.20-${{ hashFiles('**/go.sum') }}
71
+ - name : Vet
72
+ run : go vet ./...
73
+ - name : setup Terraform
74
+ uses : hashicorp/setup-terraform@v3
75
+ - name : write Terraform configuration for v5
76
+ run : |
77
+ cat > main.tf <<EOF
78
+ terraform {
79
+ required_providers {
80
+ cloudflare = {
81
+ source = "cloudflare/cloudflare"
82
+ version = "~> 5"
83
+ }
84
+ }
85
+ }
86
+ EOF
87
+ - name : terraform init
88
+ run : terraform init
89
+ - name : go test generate
90
+ env :
91
+ CLOUDFLARE_EMAIL :
[email protected]
92
+ CLOUDFLARE_API_KEY : aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
93
+ CLOUDFLARE_TERRAFORM_INSTALL_PATH : ${{ github.workspace }}
94
+ run : TESTARGS="-run=^TestResourceGenerationV5" make test
95
+
96
+ test-v5-import :
97
+ name : Go + Terraform v5 (Import)
98
+ runs-on : ubuntu-latest
99
+ steps :
100
+ - name : checkout
101
+ uses : actions/checkout@v4
102
+ with :
103
+ fetch-depth : 0
104
+ - name : install go
105
+ uses : actions/setup-go@v5
106
+ with :
107
+ go-version-file : ' go.mod'
108
+ - uses : actions/cache@v4
109
+ with :
110
+ path : ~/go/pkg/mod
111
+ key : go1.20-${{ hashFiles('**/go.sum') }}
112
+ - name : Vet
113
+ run : go vet ./...
114
+ - name : setup Terraform
115
+ uses : hashicorp/setup-terraform@v3
116
+ - name : write Terraform configuration for v5
117
+ run : |
118
+ cat > main.tf <<EOF
119
+ terraform {
120
+ required_providers {
121
+ cloudflare = {
122
+ source = "cloudflare/cloudflare"
123
+ version = "~> 5"
124
+ }
125
+ }
126
+ }
127
+ EOF
128
+ - name : terraform init
129
+ run : terraform init
130
+ - name : go test import
131
+ env :
132
+ CLOUDFLARE_EMAIL :
[email protected]
133
+ CLOUDFLARE_API_KEY : aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
134
+ CLOUDFLARE_TERRAFORM_INSTALL_PATH : ${{ github.workspace }}
135
+ run : TESTARGS="-run=^TestResourceImportV5" make test
0 commit comments