Skip to content

Update go 1.23.2 and add Terraform 1.9 to CI (#236) #59

Update go 1.23.2 and add Terraform 1.9 to CI (#236)

Update go 1.23.2 and add Terraform 1.9 to CI (#236) #59

Workflow file for this run

name: Tests
on:
push:
branches: [main]
paths-ignore:
- 'README.md'
pull_request:
types: ['opened', 'synchronize']
paths:
- '**.go'
- 'vendor/**'
- '.github/workflows/**'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: .go-version
cache: true
- name: Get dependencies
run: go mod download
- name: Build
run: go build -v .
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: .go-version
cache: true
- run: go generate ./...
- name: git diff
run: |
git diff --compact-summary --exit-code || \
(echo; echo "Unexpected difference in directories after code generation. Run 'go generate ./...' command and commit."; exit 1)
test:
name: Terraform Provider Acceptance Tests
needs: build
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
terraform:
- '1.3.*'
- '1.7.*'
- '1.8.*'
- '1.9.*'
include:
- terraform: '1.3.*'
domain: 'dnsimple-1-0-terraform.bio'
registrant_contact_id: 10854
registrant_change_domain: 'dnsimple-tf-ci-1.eu'
- terraform: '1.7.*'
domain: 'dnsimple-1-1-terraform.bio'
registrant_contact_id: 10169
registrant_change_domain: 'dnsimple-tf-ci-2.eu'
- terraform: '1.8.*'
domain: 'dnsimple-1-2-terraform.bio'
registrant_contact_id: 10854
registrant_change_domain: 'dnsimple-tf-ci-3.eu'
- terraform: '1.9.*'
domain: 'dnsimple-1-4-terraform.bio'
registrant_contact_id: 10169
registrant_change_domain: 'dnsimple-tf-ci-4.eu'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: .go-version
cache: true
- uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ matrix.terraform }}
terraform_wrapper: false
- run: go mod download
- env:
TF_ACC: '1'
DNSIMPLE_SANDBOX: true
DNSIMPLE_ACCOUNT: ${{ secrets.DNSIMPLE_ACCOUNT }}
DNSIMPLE_TOKEN: ${{ secrets.DNSIMPLE_TOKEN }}
DNSIMPLE_DOMAIN: ${{ matrix.domain }}
DNSIMPLE_CONTACT_ID: ${{ secrets.DNSIMPLE_CONTACT_ID }}
DNSIMPLE_REGISTRANT_CHANGE_DOMAIN: ${{ matrix.registrant_change_domain }}
DNSIMPLE_REGISTRANT_CHANGE_CONTACT_ID: ${{ matrix.registrant_contact_id }}
run: go test -v -cover ./internal/... -timeout 15m
timeout-minutes: 10
- run: make sweep
if: always()
env:
DNSIMPLE_SANDBOX: true
DNSIMPLE_ACCOUNT: ${{ secrets.DNSIMPLE_ACCOUNT }}
DNSIMPLE_TOKEN: ${{ secrets.DNSIMPLE_TOKEN }}
DNSIMPLE_DOMAIN: ${{ matrix.domain }}
DNSIMPLE_REGISTRANT_CHANGE_DOMAIN: ${{ matrix.registrant_change_domain }}