Skip to content

Commit

Permalink
Update go 1.23.2 and add Terraform 1.9 to CI (#236)
Browse files Browse the repository at this point in the history
* deps: bump go 1.23.2 and add TF 1.9 to CI

* ci: update domains

* tooling: update sweeper to be more robust

* tests: change to using .pw for register domain validation
  • Loading branch information
DXTimer authored Oct 17, 2024
1 parent fc98a0e commit fab13bc
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 26 deletions.
41 changes: 20 additions & 21 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,23 @@ 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 .
- 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
Expand All @@ -60,26 +59,26 @@ jobs:
matrix:
terraform:
- '1.3.*'
- '1.6.*'
- '1.7.*'
- '1.8.*'
- '1.9.*'
include:
- terraform: '1.3.*'
domain: 'dnsimple-1-0-terraform.bio'
registrant_contact_id: 10854
registrant_change_domain: 'peoa1hvrl5s7q7os1bqadhd29uar81nnc4m0oyaloxex9kapsn20u6nr8z6l5h.eu'
- terraform: '1.6.*'
registrant_change_domain: 'dnsimple-tf-ci-1.eu'
- terraform: '1.7.*'
domain: 'dnsimple-1-1-terraform.bio'
registrant_contact_id: 10169
registrant_change_domain: '9qy9lpesl2f2o5ya45zyujrggori1mh8sl6k2oz37usv48lhn3ziistg3u5kgv.eu'
- terraform: '1.7.*'
registrant_change_domain: 'dnsimple-tf-ci-2.eu'
- terraform: '1.8.*'
domain: 'dnsimple-1-2-terraform.bio'
registrant_contact_id: 10854
registrant_change_domain: 'lqyivkga231hkiqihu0k7bjic2ixd01xs5vex8rmn2iaw0l7gxvhcbicigpfm3.eu'
- terraform: '1.8.*'
registrant_change_domain: 'dnsimple-tf-ci-3.eu'
- terraform: '1.9.*'
domain: 'dnsimple-1-4-terraform.bio'
registrant_contact_id: 10169
registrant_change_domain: 'z0u2w48bo5fzgdsh1g7zjpflbpt0tiyl6tmc75ltzzm6dbphghrgepbaxs6zrm.eu'
registrant_change_domain: 'dnsimple-tf-ci-4.eu'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
Expand All @@ -92,7 +91,7 @@ jobs:
terraform_wrapper: false
- run: go mod download
- env:
TF_ACC: "1"
TF_ACC: '1'
DNSIMPLE_SANDBOX: true
DNSIMPLE_ACCOUNT: ${{ secrets.DNSIMPLE_ACCOUNT }}
DNSIMPLE_TOKEN: ${{ secrets.DNSIMPLE_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.21.10
1.23.2
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,6 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
)

go 1.21
go 1.23

toolchain go1.21.10
toolchain go1.23.2
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func TestAccRegisteredDomainResource_WithOptions(t *testing.T) {
if err != nil {
t.Fatal(err)
}
domainName := utils.RandomString(62) + ".com"
domainName := utils.RandomString(62) + ".pw"
resourceName := "dnsimple_registered_domain.test"

resource.Test(t, resource.TestCase{
Expand Down
5 changes: 4 additions & 1 deletion tools/sweep/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@ func cleanupDomains(ctx context.Context, dnsimpleClient *dnsimple.Client, accoun

fmt.Printf("Deleting domain %s\n", domain.Name)
_, err := dnsimpleClient.Domains.DeleteDomain(ctx, account, domain.Name)
if err != nil {
if err != nil && strings.Contains(err.Error(), "The domain cannot be deleted because it is either being registered or is transferring in") {
fmt.Printf("Skipping domain %s because it is being registered or is transferring in\n", domain.Name)
continue
} else if err != nil {
panic(err)
}
}
Expand Down

0 comments on commit fab13bc

Please sign in to comment.