From 39341110f0bcc0a19820d96e7419e25a157e454e Mon Sep 17 00:00:00 2001 From: Heather Lanigan Date: Wed, 11 Sep 2024 08:49:43 -0400 Subject: [PATCH 1/3] chore: start using self-hosted runners Try using the Canonical self-hosted runners available as they are available. The juju runners required setup which was never changed as they were running noble. Specifying jammy to help ensure we do not use the juju aws runners. Fix add machine test action, failed as the go version was not specified. --- .github/workflows/build.yml | 10 +++++----- .github/workflows/canary.yml | 4 ++-- .github/workflows/cla.yml | 2 +- .github/workflows/k8s_tunnel.yml | 4 ++-- .github/workflows/release.yml | 2 +- .github/workflows/test_add_machine.yml | 7 +++++-- .github/workflows/test_integration.yml | 4 ++-- .github/workflows/test_integration_jaas.yaml | 4 ++-- 8 files changed, 20 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 41bff8c0..3896d6f6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: # Ensure project builds before running testing matrix go-install: name: install - runs-on: ubuntu-latest + runs-on: [self-hosted, jammy] timeout-minutes: 5 steps: - uses: actions/checkout@v4 @@ -34,7 +34,7 @@ jobs: # Ensure the generated docs are up todate generate: - runs-on: ubuntu-latest + runs-on: [self-hosted, jammy] steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 @@ -49,7 +49,7 @@ jobs: # Ensure the go code is formatted properly format: - runs-on: ubuntu-latest + runs-on: [self-hosted, jammy] steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 @@ -66,7 +66,7 @@ jobs: # This runs golangci-lint against the codebase lint: name: golangci-lint - runs-on: ubuntu-latest + runs-on: [self-hosted, jammy] steps: - uses: actions/checkout@v4 - name: Determine which tests to run @@ -90,7 +90,7 @@ jobs: # This runs golangci-lint against the codebase copyright-check: name: copyright-check - runs-on: ubuntu-latest + runs-on: [self-hosted, jammy] steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 diff --git a/.github/workflows/canary.yml b/.github/workflows/canary.yml index 73669cec..f5972a65 100644 --- a/.github/workflows/canary.yml +++ b/.github/workflows/canary.yml @@ -14,7 +14,7 @@ jobs: # Ensure project builds before running testing matrix build: name: Build - runs-on: ubuntu-latest + runs-on: [self-hosted, jammy] timeout-minutes: 5 steps: - uses: actions/checkout@v4 @@ -29,7 +29,7 @@ jobs: name: Terraform Provider Acceptance Tests needs: - build - runs-on: ubuntu-latest + runs-on: [self-hosted, jammy] timeout-minutes: 60 strategy: fail-fast: false diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml index ec3efc8f..04301a0f 100644 --- a/.github/workflows/cla.yml +++ b/.github/workflows/cla.yml @@ -8,7 +8,7 @@ jobs: cla-check: permissions: pull-requests: write # for canonical/has-signed-canonical-cla to create & update comments - runs-on: ubuntu-latest + runs-on: [self-hosted, jammy] steps: - name: Check if CLA signed uses: canonical/has-signed-canonical-cla@1.2.3 diff --git a/.github/workflows/k8s_tunnel.yml b/.github/workflows/k8s_tunnel.yml index 1d15940f..d53b9acc 100644 --- a/.github/workflows/k8s_tunnel.yml +++ b/.github/workflows/k8s_tunnel.yml @@ -20,7 +20,7 @@ jobs: # Ensure project builds before running testing matrix build: name: Build - runs-on: ubuntu-latest + runs-on: [self-hosted, jammy] timeout-minutes: 5 steps: - uses: actions/checkout@v4 @@ -34,7 +34,7 @@ jobs: add-machine-test: name: Add Machine needs: build - runs-on: ubuntu-latest + runs-on: [self-hosted, jammy] env: ACTIONS_ALLOW_IPV6: false strategy: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 076e5de3..45878ab0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,7 +15,7 @@ permissions: jobs: goreleaser: - runs-on: ubuntu-latest + runs-on: [self-hosted, jammy] environment: Release Environment steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/test_add_machine.yml b/.github/workflows/test_add_machine.yml index 50308c18..b6d06295 100644 --- a/.github/workflows/test_add_machine.yml +++ b/.github/workflows/test_add_machine.yml @@ -28,18 +28,21 @@ jobs: # Ensure project builds before running testing matrix build: name: Build - runs-on: ubuntu-latest + runs-on: [self-hosted, jammy] timeout-minutes: 5 steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 + with: + go-version-file: "go.mod" + cache: true - run: go build -v . # Run acceptance tests in a matrix with Terraform CLI versions add-machine-test: name: Add Machine needs: build - runs-on: ubuntu-latest + runs-on: [self-hosted, jammy] env: ACTIONS_ALLOW_IPV6: false strategy: diff --git a/.github/workflows/test_integration.yml b/.github/workflows/test_integration.yml index 23549da2..aa763f9c 100644 --- a/.github/workflows/test_integration.yml +++ b/.github/workflows/test_integration.yml @@ -27,7 +27,7 @@ jobs: # Ensure project builds before running testing matrix build: name: Build - runs-on: ubuntu-latest + runs-on: [self-hosted, jammy] timeout-minutes: 5 steps: - uses: actions/checkout@v4 @@ -41,7 +41,7 @@ jobs: test: name: Integration needs: build - runs-on: ubuntu-latest + runs-on: [self-hosted, jammy] strategy: fail-fast: false matrix: diff --git a/.github/workflows/test_integration_jaas.yaml b/.github/workflows/test_integration_jaas.yaml index 8250d7a1..22c288cd 100644 --- a/.github/workflows/test_integration_jaas.yaml +++ b/.github/workflows/test_integration_jaas.yaml @@ -28,7 +28,7 @@ jobs: # Ensure project builds before running test build: name: Build - runs-on: ubuntu-latest + runs-on: [self-hosted, jammy] timeout-minutes: 5 steps: - uses: actions/checkout@v4 @@ -41,7 +41,7 @@ jobs: test: name: Integration needs: build - runs-on: ubuntu-latest + runs-on: [self-hosted, jammy] strategy: fail-fast: false timeout-minutes: 60 From dc825284ff13e2d4095d52f6afd72499fb5602dc Mon Sep 17 00:00:00 2001 From: Heather Lanigan Date: Tue, 24 Sep 2024 15:08:03 -0400 Subject: [PATCH 2/3] fix: error summary changes on login failure test Check the error details, the error summary changes based on different runners. Sometimes expected: "i/o timeout" vs "connect: connection refused" --- internal/provider/provider_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/provider/provider_test.go b/internal/provider/provider_test.go index 5ed4521b..08b6b50d 100644 --- a/internal/provider/provider_test.go +++ b/internal/provider/provider_test.go @@ -133,7 +133,6 @@ func TestProviderConfigureAddresses(t *testing.T) { assert.Equal(t, confResp.Diagnostics.HasError(), true) err := confResp.Diagnostics.Errors()[0] assert.Equal(t, diag.SeverityError, err.Severity()) - assert.Equal(t, "dial tcp 192.0.2.100:17070: i/o timeout", err.Summary()) assert.Equal(t, "Connection error, please check the controller_addresses property set on the provider", err.Detail()) } From cab734e9b1992bc28ab9b74154dd6be99ee7eb39 Mon Sep 17 00:00:00 2001 From: Heather Lanigan Date: Fri, 27 Sep 2024 12:04:59 +0000 Subject: [PATCH 3/3] fix: generate requires terraform to be installed Used to build the docs from schemas. Not all runners have terraform installed, ensure it is available. --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3896d6f6..bf61e395 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,6 +41,10 @@ jobs: with: go-version-file: "go.mod" cache: true + - uses: hashicorp/setup-terraform@v3 + with: + terraform_version: "1.9.*" + terraform_wrapper: false - run: go generate ./... - name: git diff run: |