Skip to content

Commit cfdb868

Browse files
committed
terraform: add more sample tests and ci workflow
1 parent c5a0e81 commit cfdb868

107 files changed

Lines changed: 3977 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Samples Terraform
2+
3+
on:
4+
push:
5+
paths:
6+
- 'samples/client/petstore/terraform/**'
7+
- 'samples/client/petstore/terraform-addpet/**'
8+
- 'samples/client/petstore/terraform-server/**'
9+
- 'samples/client/others/terraform/**'
10+
pull_request:
11+
paths:
12+
- 'samples/client/petstore/terraform/**'
13+
- 'samples/client/petstore/terraform-addpet/**'
14+
- 'samples/client/petstore/terraform-server/**'
15+
- 'samples/client/others/terraform/**'
16+
17+
jobs:
18+
build:
19+
name: Build Terraform Provider
20+
runs-on: ubuntu-latest
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
sample:
25+
- samples/client/petstore/terraform/
26+
- samples/client/petstore/terraform-addpet/
27+
- samples/client/petstore/terraform-server/
28+
- samples/client/others/terraform/allof-discriminator/
29+
- samples/client/others/terraform/oneof-anyof-required/
30+
- samples/client/others/terraform/oneof-discriminator-lookup/
31+
steps:
32+
- uses: actions/checkout@v5
33+
- uses: actions/setup-go@v6
34+
with:
35+
go-version: "stable"
36+
- run: go version
37+
- name: Build provider
38+
working-directory: ${{ matrix.sample }}
39+
run: go build -v ./...
40+
- name: Run acceptance tests
41+
working-directory: ${{ matrix.sample }}
42+
run: TF_ACC=1 go test ./... -v -timeout 120m
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
generatorName: terraform-provider
2+
outputDir: samples/client/others/terraform/allof-discriminator
3+
inputSpec: modules/openapi-generator/src/test/resources/3_0/go/allof_multiple_ref_and_discriminator.yaml
4+
templateDir: modules/openapi-generator/src/main/resources/terraform-provider
5+
gitHost: github.com
6+
gitUserId: example
7+
gitRepoId: terraform-provider-allof
8+
additionalProperties:
9+
providerName: "allof"
10+
providerAddress: "registry.terraform.io/example/allof"
11+
hideGenerationTimestamp: "true"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
generatorName: terraform-provider
2+
outputDir: samples/client/others/terraform/oneof-anyof-required
3+
inputSpec: modules/openapi-generator/src/test/resources/3_0/go/spec-with-oneof-anyof-required.yaml
4+
templateDir: modules/openapi-generator/src/main/resources/terraform-provider
5+
gitHost: github.com
6+
gitUserId: example
7+
gitRepoId: terraform-provider-oneof-anyof
8+
additionalProperties:
9+
providerName: "oneof"
10+
providerAddress: "registry.terraform.io/example/oneof-anyof"
11+
hideGenerationTimestamp: "true"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
generatorName: terraform-provider
2+
outputDir: samples/client/others/terraform/oneof-discriminator-lookup
3+
inputSpec: modules/openapi-generator/src/test/resources/3_0/go/spec-with-oneof-discriminator.yaml
4+
templateDir: modules/openapi-generator/src/main/resources/terraform-provider
5+
gitHost: github.com
6+
gitUserId: example
7+
gitRepoId: terraform-provider-oneof-disc
8+
additionalProperties:
9+
providerName: "oneof"
10+
providerAddress: "registry.terraform.io/example/oneof-disc"
11+
hideGenerationTimestamp: "true"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
generatorName: terraform-provider
2+
outputDir: samples/client/petstore/terraform-addpet
3+
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-addpet-only.yaml
4+
templateDir: modules/openapi-generator/src/main/resources/terraform-provider
5+
gitHost: github.com
6+
gitUserId: example
7+
gitRepoId: terraform-provider-petstore-addpet
8+
additionalProperties:
9+
providerName: "petstore"
10+
providerAddress: "registry.terraform.io/example/petstore-addpet"
11+
hideGenerationTimestamp: "true"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
generatorName: terraform-provider
2+
outputDir: samples/client/petstore/terraform-server
3+
inputSpec: modules/openapi-generator/src/test/resources/3_0/go-server/petstore.yaml
4+
templateDir: modules/openapi-generator/src/main/resources/terraform-provider
5+
gitHost: github.com
6+
gitUserId: example
7+
gitRepoId: terraform-provider-petstore-server
8+
additionalProperties:
9+
providerName: "petstore"
10+
providerAddress: "registry.terraform.io/example/petstore-server"
11+
hideGenerationTimestamp: "true"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
*.dll
2+
*.exe
3+
*.exe~
4+
*.dylib
5+
*.so
6+
*.test
7+
*.out
8+
*.tfstate
9+
*.tfstate.*
10+
.terraform/
11+
terraform.tfvars
12+
terraform-provider-allof
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.gitignore
2+
GNUmakefile
3+
README.md
4+
examples/provider/provider.tf
5+
go.mod
6+
internal/client/client.go
7+
internal/client/model_additional_data.go
8+
internal/client/model_base/item.go
9+
internal/client/model_final_item.go
10+
internal/provider/provider.go
11+
main.go
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7.20.0-SNAPSHOT

0 commit comments

Comments
 (0)