Skip to content

Devcontainer

Devcontainer #250

Workflow file for this run

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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Setup Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version-file: 'go.mod'
cache: true
- name: Setup Terraform
if: matrix.tool == 'terraform'
uses: hashicorp/setup-terraform@651471c36a6092792c552e8b1bef71e592b462d8 # v3.1.1
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