Fix release workflow #257
Workflow file for this run
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: Tests | |
on: | |
pull_request: | |
branches: | |
- "main" | |
types: [ opened, synchronize ] | |
permissions: | |
contents: read | |
env: | |
CGO_ENABLED: 1 | |
CGO_LDFLAGS: '-static -Wl,-unresolved-symbols=ignore-all' | |
CC: musl-gcc | |
jobs: | |
acctest: | |
name: "${{ matrix.tool }} v${{ matrix.version }}: Provider Acceptance Tests" | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 15 | |
strategy: | |
max-parallel: 1 | |
fail-fast: false | |
matrix: | |
tool: [terraform, opentofu] | |
version: ['1.5.*', '1.6.*', '1.7.*', '1.8.*', '1.9.*', '1.6', '1.7', '1.8'] | |
exclude: | |
- tool: terraform | |
version: '1.6' | |
- tool: terraform | |
version: '1.7' | |
- tool: terraform | |
version: '1.8' | |
- tool: opentofu | |
version: '1.5.*' | |
- tool: opentofu | |
version: '1.6.*' | |
- tool: opentofu | |
version: '1.7.*' | |
- tool: opentofu | |
version: '1.8.*' | |
- tool: opentofu | |
version: '1.9.*' | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Setup Go | |
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0 | |
with: | |
go-version-file: 'go.mod' | |
cache: true | |
- name: Setup Terraform | |
if: matrix.tool == 'terraform' | |
uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2 | |
with: | |
terraform_version: ${{ matrix.version }} | |
terraform_wrapper: false | |
- name: Setup OpenTofu | |
if: matrix.tool == 'opentofu' | |
uses: opentofu/setup-opentofu@592200bd4b9bbf4772ace78f887668b1aee8f716 # v1.0.5 | |
with: | |
tofu_version: ${{ matrix.version }} | |
tofu_wrapper: false | |
- name: Install Go dependencies | |
run: go mod tidy | |
- name: Install build dependencies | |
run: sudo apt update && sudo apt install musl-tools -y | |
- name: Create bw client configuration file | |
run: | | |
echo 'BW_API_URL="${{ secrets.BW_API_URL }}"' >> .env.local.test | |
echo 'BW_API_URL="${{ secrets.BW_API_URL }}"' >> .env.local.no.access | |
echo 'BW_IDENTITY_API_URL="${{ secrets.BW_IDENTITY_API_URL }}"' >> .env.local.test | |
echo 'BW_IDENTITY_API_URL="${{ secrets.BW_IDENTITY_API_URL }}"' >> .env.local.no.access | |
echo 'BW_ORGANIZATION_ID="${{ secrets.BW_ORGANIZATION_ID_NO_ACCESS }}"' >> .env.local.test | |
echo 'BW_ORGANIZATION_ID="${{ secrets.BW_ORGANIZATION_ID_NO_ACCESS }}"' >> .env.local.no.access | |
echo 'BW_ACCESS_TOKEN="${{ secrets.BW_ACCESS_TOKEN }}"' >> .env.local.test | |
echo 'BW_ACCESS_TOKEN="${{ secrets.BW_ACCESS_TOKEN_NO_ACCESS }}"' >> .env.local.no.access | |
echo 'BW_STATE_FILE=".bw-state-qa"' >> .env.local.test | |
echo 'BW_STATE_FILE=".bw-state-qa-no-access"' >> .env.local.no.access | |
- name: Run acceptance tests | |
run: | | |
if [[ "${{ matrix.tool }}" == "terraform" ]]; then | |
make testacc | |
elif [[ "${{ matrix.tool }}" == "opentofu" ]]; then | |
make testacc_tofu | |
fi |