Tests #137
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 GitHub action runs your tests for each commit push and/or PR. Optionally | |
# you can turn it on using a cron schedule for regular testing. | |
# | |
name: Tests | |
on: | |
push: | |
paths-ignore: | |
- 'README.md' | |
# Run daily tests | |
schedule: | |
- cron: '0 10 * * *' | |
jobs: | |
# ensure the code builds... | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.20' | |
id: go | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
- name: Get dependencies | |
run: | | |
go mod download | |
- name: Build | |
run: | | |
go build -v . | |
# run acceptance tests in a matrix with Terraform core versions | |
outbound-tests: | |
uses: ./.github/workflows/test-workflow.yml | |
name: Outbound | |
needs: build | |
with: | |
package-path: './genesyscloud/...' | |
run-regexp: '(Outbound)+' | |
coverage-out-filename: 'ob-coverage.out' | |
coverage-html-filename: 'ob-coverage.html' | |
test-log-artifact-name: 'outbound logs' | |
secrets: | |
client-id: ${{ secrets.TEST_GENESYSCLOUD_OAUTHCLIENT_ID }} | |
client-secret: ${{ secrets.TEST_GENESYSCLOUD_OAUTHCLIENT_SECRET }} | |
export-tests: | |
uses: ./.github/workflows/test-workflow.yml | |
name: Export | |
needs: build | |
with: | |
package-path: './genesyscloud/tfexporter/...' | |
coverage-out-filename: 'export-coverage.out' | |
coverage-html-filename: 'export-coverage.html' | |
running-export-tests: 'true' | |
test-log-artifact-name: 'export logs' | |
sdk-log-artifact-name: 'export sdk_log' | |
sdk-debug-log-file-path: './genesyscloud/tfexporter/sdk_debug.log' | |
secrets: | |
client-id: ${{ secrets.TEST_GENESYSCLOUD_OAUTHCLIENT_ID }} | |
client-secret: ${{ secrets.TEST_GENESYSCLOUD_OAUTHCLIENT_SECRET }} | |
routing-tests: | |
uses: ./.github/workflows/test-workflow.yml | |
name: Routing | |
needs: build | |
with: | |
package-path: './genesyscloud/...' | |
run-regexp: '(Routing)+' | |
coverage-out-filename: 'routing-coverage.out' | |
coverage-html-filename: 'routing-coverage.html' | |
test-log-artifact-name: 'routing logs' | |
sdk-log-artifact-name: 'routing sdk_log' | |
secrets: | |
client-id: ${{ secrets.TEST_GENESYSCLOUD_OAUTHCLIENT_ID }} | |
client-secret: ${{ secrets.TEST_GENESYSCLOUD_OAUTHCLIENT_SECRET }} | |
all-other-unit-tests: | |
uses: ./.github/workflows/test-workflow.yml | |
name: All Other Unit Tests | |
needs: build | |
with: | |
package-path: './genesyscloud/...' | |
skip-regexp: 'TfExport|Outbound|Routing|TestAccDataSource|TestAccResource' | |
coverage-out-filename: 'unit-coverage.out' | |
coverage-html-filename: 'unit-coverage.html' | |
test-log-artifact-name: 'unit test logs' | |
tf-unit: '*' | |
secrets: | |
client-id: ${{ secrets.TEST_GENESYSCLOUD_OAUTHCLIENT_ID }} | |
client-secret: ${{ secrets.TEST_GENESYSCLOUD_OAUTHCLIENT_SECRET }} | |
all-other-datasource-tests: | |
needs: build | |
if: ${{ always() }} | |
uses: ./.github/workflows/test-workflow.yml | |
name: All Other DataSource Tests | |
with: | |
package-path: './genesyscloud/...' | |
skip-regexp: '(TfExport)+|(Outbound)+|(Routing)+' | |
run-regexp: 'TestAccDataSource' | |
coverage-out-filename: 'data-source-coverage.out' | |
coverage-html-filename: 'data-source-coverage.html' | |
test-log-artifact-name: 'data source tests logs' | |
secrets: | |
client-id: ${{ secrets.TEST_GENESYSCLOUD_OAUTHCLIENT_ID }} | |
client-secret: ${{ secrets.TEST_GENESYSCLOUD_OAUTHCLIENT_SECRET }} | |
all-other-resource-tests: | |
uses: ./.github/workflows/test-workflow.yml | |
name: All Other Resource Tests | |
needs: build | |
if: ${{ always() }} | |
with: | |
package-path: './genesyscloud/...' | |
skip-regexp: '(TfExport)+|(Outbound)+|(Routing)+' | |
run-regexp: 'TestAccResource' | |
coverage-out-filename: 'resource-coverage.out' | |
coverage-html-filename: 'resource-coverage.html' | |
test-log-artifact-name: 'resource tests logs' | |
secrets: | |
client-id: ${{ secrets.TEST_GENESYSCLOUD_OAUTHCLIENT_ID }} | |
client-secret: ${{ secrets.TEST_GENESYSCLOUD_OAUTHCLIENT_SECRET }} |