Merge pull request #433 from philips-software/dependabot/go_modules/g… #460
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
name: Terraform Provider Tests | |
on: | |
push: | |
branches: [main] | |
paths: | |
- '**.go' | |
- '**.mod' | |
pull_request: | |
# The branches below must be a subset of the branches above | |
branches: [main] | |
paths: | |
- '**.go' | |
- '**.mod' | |
permissions: | |
# Permission for checking out code | |
contents: read | |
jobs: | |
detect-noop: | |
runs-on: ubuntu-22.04 | |
outputs: | |
noop: ${{ steps.noop.outputs.should_skip }} | |
steps: | |
- name: Detect No-op Changes | |
id: noop | |
uses: fkirc/skip-duplicate-actions@v5.3.1 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
paths_ignore: '["**.md", "**.png", "**.jpg"]' | |
do_not_skip: '["workflow_dispatch", "schedule"]' | |
acceptance: | |
needs: detect-noop | |
if: needs.detect-noop.outputs.noop != 'true' | |
name: Acceptance Tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: '1.23' | |
- uses: hashicorp/setup-terraform@v3 | |
with: | |
terraform_version: '1.3.*' | |
terraform_wrapper: false | |
- run: go test -v -timeout=15m -cover ./... | |
env: | |
TF_ACC: '1' | |
HSDP_REGION: ${{ secrets.HSDP_REGION }} | |
HSDP_ENVIRONMENT: ${{ secrets.HSDP_ENVIRONMENT }} | |
HSDP_IAM_ACC_ORG_GUID: ${{ secrets.HSDP_IAM_ACC_ORG_GUID }} | |
HSDP_IAM_ACC_USER_GUID: ${{ secrets.HSDP_IAM_ACC_USER_GUID }} | |
HSDP_IAM_SERVICE_ID: ${{ secrets.HSDP_IAM_SERVICE_ID }} | |
HSDP_IAM_SERVICE_PRIVATE_KEY: ${{ secrets.HSDP_IAM_SERVICE_PRIVATE_KEY }} | |
HSDP_IAM_OAUTH2_CLIENT_ID: ${{ secrets.HSDP_IAM_OAUTH2_CLIENT_ID }} | |
HSDP_IAM_OAUTH2_PASSWORD: ${{ secrets.HSDP_IAM_OAUTH2_PASSWORD }} | |
HSDP_MDM_ACC_ORG_ID: ${{ secrets.HSDP_MDM_ACC_ORG_ID }} | |
HSDP_MDM_ACC_CLIENT_ID: ${{ secrets.HSDP_MDM_ACC_CLIENT_ID }} | |
HSDP_MDM_ACC_CLIENT_SECRET: ${{ secrets.HSDP_MDM_ACC_CLIENT_SECRET }} | |
HSDP_UAA_USERNAME: ${{ secrets.HSDP_UAA_USERNAME }} | |
HSDP_UAA_PASSWORD: ${{ secrets.HSDP_UAA_PASSWORD }} | |
HSDP_CDR_ACC_URL: ${{ secrets.HSDP_CDR_ACC_URL }} | |
HSDP_SHARED_KEY: ${{ secrets.HSDP_SHARED_KEY }} | |
HSDP_SECRET_KEY: ${{ secrets.HSDP_SECRET_KEY }} | |
HSDP_DEBUG_LOG: /tmp/debug.log | |
- uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: debug-log | |
path: /tmp/debug.log | |
unit: | |
needs: detect-noop | |
if: needs.detect-noop.outputs.noop != 'true' | |
name: Unit Tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: '1.21' | |
- run: go test -v -cover ./... |