-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added CI pipeline and tests (#3)
- Loading branch information
1 parent
ed369b3
commit dee0ab7
Showing
6 changed files
with
168 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,11 @@ | ||
# TODO: Add CI workflow | ||
name: CI-Pipeline | ||
|
||
# Controls when the workflow will run, when comment is created | ||
on: | ||
issue_comment: | ||
types: | ||
- created | ||
jobs: | ||
call-terraform-ci-pipeline: | ||
uses: terraform-ibm-modules/common-pipeline-assets/.github/workflows/[email protected] | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: Release-Pipeline | ||
|
||
# Trigger on push(merge) to main branch | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
call-terraform-release-pipeline: | ||
uses: terraform-ibm-modules/common-pipeline-assets/.github/workflows/[email protected] | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Tests | ||
|
||
For information about how to create and run tests, see [Validation tests](https://terraform-ibm-modules.github.io/documentation/#/tests) in the project documentation. | ||
|
||
<!-- Add any more steps that are specific to testing this module and that are not in the docs. --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
module github.com/terraform-ibm-modules/stack-ibm-template | ||
|
||
go 1.21 | ||
|
||
toolchain go1.21.3 | ||
|
||
require ( | ||
github.com/stretchr/testify v1.9.0 | ||
github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper v1.31.1 | ||
) | ||
|
||
require ( | ||
github.com/IBM-Cloud/bluemix-go v0.0.0-20240402122236-5c5b994a3f1a // indirect | ||
github.com/IBM-Cloud/power-go-client v1.6.0 // indirect | ||
github.com/IBM/cloud-databases-go-sdk v0.6.0 // indirect | ||
github.com/IBM/go-sdk-core/v5 v5.17.0 // indirect | ||
github.com/IBM/platform-services-go-sdk v0.62.6 // indirect | ||
github.com/IBM/project-go-sdk v0.2.9 // indirect | ||
github.com/IBM/vpc-go-sdk v0.50.0 // indirect | ||
github.com/Microsoft/go-winio v0.6.1 // indirect | ||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect | ||
github.com/cyphar/filepath-securejoin v0.2.4 // indirect | ||
github.com/davecgh/go-spew v1.1.1 // indirect | ||
github.com/gabriel-vasile/mimetype v1.4.3 // indirect | ||
github.com/ghodss/yaml v1.0.0 // indirect | ||
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect | ||
github.com/go-git/go-billy/v5 v5.5.0 // indirect | ||
github.com/go-git/go-git/v5 v5.12.0 // indirect | ||
github.com/go-logr/logr v1.3.0 // indirect | ||
github.com/go-logr/stdr v1.2.2 // indirect | ||
github.com/go-openapi/analysis v0.21.5 // indirect | ||
github.com/go-openapi/errors v0.22.0 // indirect | ||
github.com/go-openapi/jsonpointer v0.20.1 // indirect | ||
github.com/go-openapi/jsonreference v0.20.3 // indirect | ||
github.com/go-openapi/loads v0.21.3 // indirect | ||
github.com/go-openapi/runtime v0.26.0 // indirect | ||
github.com/go-openapi/spec v0.20.12 // indirect | ||
github.com/go-openapi/strfmt v0.23.0 // indirect | ||
github.com/go-openapi/swag v0.22.5 // indirect | ||
github.com/go-openapi/validate v0.22.4 // indirect | ||
github.com/go-playground/locales v0.14.1 // indirect | ||
github.com/go-playground/universal-translator v0.18.1 // indirect | ||
github.com/go-playground/validator/v10 v10.19.0 // indirect | ||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect | ||
github.com/google/go-cmp v0.6.0 // indirect | ||
github.com/google/uuid v1.6.0 // indirect | ||
github.com/gruntwork-io/terratest v0.46.13 // indirect | ||
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect | ||
github.com/hashicorp/go-retryablehttp v0.7.5 // indirect | ||
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect | ||
github.com/jinzhu/copier v0.4.0 // indirect | ||
github.com/josharian/intern v1.0.0 // indirect | ||
github.com/kevinburke/ssh_config v1.2.0 // indirect | ||
github.com/leodido/go-urn v1.4.0 // indirect | ||
github.com/mailru/easyjson v0.7.7 // indirect | ||
github.com/mitchellh/mapstructure v1.5.0 // indirect | ||
github.com/oklog/ulid v1.3.1 // indirect | ||
github.com/opentracing/opentracing-go v1.2.0 // indirect | ||
github.com/pjbgf/sha1cd v0.3.0 // indirect | ||
github.com/pmezard/go-difflib v1.0.0 // indirect | ||
github.com/skeema/knownhosts v1.2.2 // indirect | ||
github.com/xanzy/ssh-agent v0.3.3 // indirect | ||
go.mongodb.org/mongo-driver v1.14.0 // indirect | ||
go.opentelemetry.io/otel v1.16.0 // indirect | ||
go.opentelemetry.io/otel/metric v1.16.0 // indirect | ||
go.opentelemetry.io/otel/trace v1.16.0 // indirect | ||
golang.org/x/crypto v0.22.0 // indirect | ||
golang.org/x/mod v0.14.0 // indirect | ||
golang.org/x/net v0.23.0 // indirect | ||
golang.org/x/sys v0.19.0 // indirect | ||
golang.org/x/text v0.14.0 // indirect | ||
golang.org/x/tools v0.16.1 // indirect | ||
gopkg.in/warnings.v0 v0.1.2 // indirect | ||
gopkg.in/yaml.v2 v2.4.0 // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package tests | ||
|
||
import ( | ||
"fmt" | ||
"github.com/stretchr/testify/assert" | ||
"github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/testprojects" | ||
"os" | ||
"testing" | ||
) | ||
|
||
func TestProjectsFullTest(t *testing.T) { | ||
|
||
options := testprojects.TestProjectOptionsDefault(&testprojects.TestProjectsOptions{ | ||
Testing: t, | ||
StackConfigurationOrder: []string{ | ||
"primary-da", | ||
"secondary-da", | ||
}, | ||
}) | ||
options.StackMemberInputs = map[string]map[string]interface{}{ | ||
"primary-da": { | ||
"prefix": fmt.Sprintf("p%s", options.Prefix), | ||
}, | ||
"secondary-da": { | ||
"prefix": fmt.Sprintf("s%s", options.Prefix), | ||
}, | ||
} | ||
options.StackInputs = map[string]interface{}{ | ||
"resource_group_name": options.ResourceGroup, | ||
"ibmcloud_api_key": os.Getenv("TF_VAR_ibmcloud_api_key"), | ||
} | ||
|
||
err := options.RunProjectsTest() | ||
if assert.NoError(t, err) { | ||
t.Log("TestProjectsFullTest Passed") | ||
} else { | ||
t.Error("TestProjectsFullTest Failed") | ||
} | ||
} |