From 8b951e430e97b8dd9544407c47a79fd74dcf3ef2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Czoma?= Date: Thu, 20 Jun 2024 09:52:46 -0400 Subject: [PATCH] Added ability to test with unreleased private provider version (#19) --- .github/workflows/module-test-pipeline.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/module-test-pipeline.yml b/.github/workflows/module-test-pipeline.yml index 5e4d113..167d944 100644 --- a/.github/workflows/module-test-pipeline.yml +++ b/.github/workflows/module-test-pipeline.yml @@ -10,8 +10,11 @@ jobs: - name: Check out code uses: actions/checkout@v4 - - name: Set up Terraform latest - uses: hashicorp/setup-terraform@v2 + - name: Set up Terraform latest - with token + uses: hashicorp/setup-terraform@v3 + with: + cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }} + terraform_wrapper: true - name: Setup test broker run: | @@ -20,6 +23,15 @@ jobs: --env system_scaling_maxconnectioncount="1000" --mount type=bind,source=$HOME/solace,destination=/var/lib/solace,ro=false solace/solace-pubsub-standard:latest while ! curl -s localhost:8080 | grep aurelia ; do sleep 1 ; done + - name: Setup if private provider is required + run: | + export PRIVATE_PROVIDER_VERSION="1.0.0-rc.6" + if [ -n "$PRIVATE_PROVIDER_VERSION" ]; then + echo "Using private provider version $PRIVATE_PROVIDER_VERSION" + grep -rl 'source = "' . | xargs sed -i 's@source = ".*$@source = "app.terraform.io/SolaceDev/solacebroker"@g' + grep -rl 'version = "' . | xargs sed -i "s@ version = \".*\$@ version = \"${PRIVATE_PROVIDER_VERSION}\"@g" + fi + - name: Test module from template on test broker run: | ci/scripts/test-module.sh ci/template-test @@ -34,6 +46,10 @@ jobs: for d in examples/!(basic-client-username)/; do (ci/scripts/test-module.sh "$d"); done # ci/scripts/test-module.sh examples/basic-client-username/ -var-file=secret.tfvars + - name: Discard any changes in checked out code + run: | + git checkout -- . + - name: Set up Go uses: actions/setup-go@v3 with: