forked from MyPureCloud/terraform-provider-genesyscloud
-
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.
Merge branch 'main' into DEVTOOLING-337
- Loading branch information
Showing
49 changed files
with
1,389 additions
and
295 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 |
---|---|---|
@@ -0,0 +1,114 @@ | ||
name: test_workflow | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
package-path: | ||
required: true | ||
type: string | ||
skip-regexp: | ||
type: string | ||
default: '' | ||
run-regexp: | ||
type: string | ||
default: '' | ||
test-log-artifact-name: | ||
type: string | ||
required: true | ||
sdk-log-artifact-name: | ||
type: string | ||
required: true | ||
sdk-debug-log-file-path: | ||
type: string | ||
default: './genesyscloud/sdk_debug.log' | ||
running-export-tests: | ||
type: string | ||
default: 'false' | ||
coverage-out-filename: | ||
type: string | ||
default: '' | ||
coverage-html-filename: | ||
type: string | ||
default: '' | ||
secrets: | ||
client-id: | ||
description: 'Genesys Cloud Client ID' | ||
required: true | ||
client-secret: | ||
description: 'Genesys Cloud Client Secret' | ||
required: true | ||
|
||
jobs: | ||
matrix: | ||
name: '' | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 80 | ||
strategy: | ||
fail-fast: false | ||
max-parallel: 2 | ||
matrix: | ||
# list whatever Terraform versions here you would like to support | ||
terraform: | ||
- '1.6.6' | ||
steps: | ||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.20' | ||
id: go | ||
|
||
- name: Setup Terraform CLI | ||
uses: hashicorp/setup-terraform@v3.0.0 | ||
with: | ||
terraform_version: ${{ matrix.terraform }} | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get dependencies | ||
run: | | ||
go mod download | ||
- name: TF acceptance tests | ||
timeout-minutes: 80 | ||
env: | ||
TF_ACC: '1' | ||
TF_LOG: 'DEBUG' | ||
TF_LOG_PATH: ${{ github.workspace }}/test.log | ||
TF_ACC_TERRAFORM_VERSION: ${{ matrix.terraform }} | ||
|
||
GENESYSCLOUD_OAUTHCLIENT_ID: ${{ secrets.client-id }} | ||
GENESYSCLOUD_OAUTHCLIENT_SECRET: ${{ secrets.client-secret }} | ||
GENESYSCLOUD_REGION: 'us-east-1' | ||
GENESYSCLOUD_SDK_DEBUG: 'true' | ||
GENESYSCLOUD_TOKEN_POOL_SIZE: 20 | ||
run: | | ||
if [ "$TF_ACC_TERRAFORM_VERSION" == "0.14.7" ]; then | ||
sleep 300 # This avoids conflicts with the API and other related issues e.g. too many routing email domains | ||
fi | ||
go test -timeout 80m -v -cover ${{ inputs.package-path }} -parallel 20 -coverprofile="${{ inputs.coverage-out-filename }}" -skip="${{ inputs.skip-regexp }}" -run="${{ inputs.run-regexp }}" | ||
go tool cover -html="${{ inputs.coverage-out-filename }}" -o="${{ inputs.coverage-html-filename }}" | ||
- name: 'Upload Logs' | ||
if: ${{ always() }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ inputs.test-log-artifact-name }} ${{ matrix.terraform }} | ||
path: ${{ github.workspace }}/test.log | ||
retention-days: 5 | ||
|
||
- name: 'Upload SDK Log' | ||
if: ${{ always() }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ inputs.sdk-log-artifact-name }} ${{ matrix.terraform }} | ||
path: ${{ inputs.sdk-debug-log-file-path }} | ||
retention-days: 5 | ||
|
||
- name: 'Upload Export Result' | ||
if: ${{ inputs.running-export-tests == 'true' }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: export-result ${{ matrix.terraform }} | ||
path: ${{ github.workspace }}/.terraform/ | ||
retention-days: 5 |
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
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
Oops, something went wrong.