From 9ace19deb37d6182b18a36ef433cb8ab5d0717bb Mon Sep 17 00:00:00 2001 From: dntosas Date: Wed, 17 Jul 2024 16:32:46 +0300 Subject: [PATCH] chore: update gh-action versions Signed-off-by: dntosas --- .github/workflows/ci.yml | 10 +++---- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/go-release.yml | 4 +-- .github/workflows/helm-release.yml | 2 +- Makefile | 4 +-- controllers/capi2argo_reconciler_test.go | 34 ++++++++++++------------ 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f884d41c..dce40162 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,12 +16,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Set up Go - uses: actions/setup-go@v5.0.0 + uses: actions/setup-go@v5 with: go-version: '1.22' - name: Checkout code - uses: actions/checkout@v4.1.1 + uses: actions/checkout@v4 - name: Run go fmt run: make fmt @@ -30,16 +30,16 @@ jobs: run: make vet - name: Run go lint - uses: golangci/golangci-lint-action@v4 + uses: golangci/golangci-lint-action@v6 with: - version: v1.54.2 + version: v1.59.1 args: --timeout 5m --enable revive,gofmt,exportloopref --exclude-use-default=false --modules-download-mode=vendor --build-tags integration - name: Run go test run: make test - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} env_vars: GO diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 91b7d5be..f639c451 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -36,7 +36,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4.1.1 + uses: actions/checkout@v4 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/go-release.yml b/.github/workflows/go-release.yml index af407f7d..0696e9bf 100644 --- a/.github/workflows/go-release.yml +++ b/.github/workflows/go-release.yml @@ -10,12 +10,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Set up Go - uses: actions/setup-go@v5.0.0 + uses: actions/setup-go@v5 with: go-version: '1.22' - name: Checkout code - uses: actions/checkout@v4.1.1 + uses: actions/checkout@v4 with: fetch-depth: 0 diff --git a/.github/workflows/helm-release.yml b/.github/workflows/helm-release.yml index 6ecdf5ab..397d4371 100644 --- a/.github/workflows/helm-release.yml +++ b/.github/workflows/helm-release.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4.1.1 + uses: actions/checkout@v4 with: fetch-depth: 0 diff --git a/Makefile b/Makefile index 2929e583..a038a978 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ GROUP = $(shell id -g) PROJECT = "capi2argo-cluster-operator" GOBUILD_OPTS = -ldflags="-s -w -X ${PROJECT}/cmd.Version=${VERSION} -X ${PROJECT}/cmd.CommitHash=${COMMIT}" GO_IMAGE = "golang:1.22-alpine" -GO_IMAGE_CI = "golangci/golangci-lint:v1.54.2" +GO_IMAGE_CI = "golangci/golangci-lint:v1.59.1" DISTROLESS_IMAGE = "gcr.io/distroless/static:nonroot" IMAGE_TAG_BASE ?= "ghcr.io/dntosas/${PROJECT}" @@ -39,7 +39,7 @@ vet: ## Run go vet against code. .PHONY: lint lint: ## Run golangci-lint against code. - golangci-lint run --enable gofmt,exportloopref --exclude-use-default=false --modules-download-mode=vendor --build-tags integration + golangci-lint run --enable revive,gofmt,exportloopref --exclude-use-default=false --modules-download-mode=vendor --build-tags integration .PHONY: test test: envtest ## Run go tests against code. diff --git a/controllers/capi2argo_reconciler_test.go b/controllers/capi2argo_reconciler_test.go index 7c9bbbb8..bcee7726 100644 --- a/controllers/capi2argo_reconciler_test.go +++ b/controllers/capi2argo_reconciler_test.go @@ -2,8 +2,8 @@ package controllers import ( "context" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" + "github.com/onsi/ginkgo" + "github.com/onsi/gomega" "github.com/stretchr/testify/assert" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -32,25 +32,25 @@ var ( ) func TestControllers(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Capi2ArgoClusterOperator Controller Suite") + gomega.RegisterFailHandler(ginkgo.Fail) + ginkgo.RunSpecs(t, "Capi2ArgoClusterOperator Controller Suite") } -var _ = BeforeSuite(func() { - By("bootstrapping test environment") - logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true))) +var _ = ginkgo.BeforeSuite(func() { + ginkgo.By("bootstrapping test environment") + logf.SetLogger(zap.New(zap.WriteTo(ginkgo.GinkgoWriter), zap.UseDevMode(true))) TestEnv = &envtest.Environment{} Cfg, err := TestEnv.Start() - Expect(err).NotTo(HaveOccurred()) - Expect(Cfg).NotTo(BeNil()) + gomega.Expect(err).NotTo(gomega.HaveOccurred()) + gomega.Expect(Cfg).NotTo(gomega.BeNil()) //+kubebuilder:scaffold:scheme K8sManager, err := ctrl.NewManager(Cfg, ctrl.Options{ // Host: "0.0.0.0", Scheme: scheme.Scheme, }) - Expect(err).ToNot(HaveOccurred()) + gomega.Expect(err).ToNot(gomega.HaveOccurred()) C2A = &Capi2Argo{ Client: K8sManager.GetClient(), @@ -58,21 +58,21 @@ var _ = BeforeSuite(func() { Scheme: K8sManager.GetScheme(), } err = C2A.SetupWithManager(K8sManager) - Expect(err).ToNot(HaveOccurred()) + gomega.Expect(err).ToNot(gomega.HaveOccurred()) Ctx, Cancel = context.WithCancel(context.TODO()) go func() { - defer GinkgoRecover() + defer ginkgo.GinkgoRecover() err = K8sManager.Start(Ctx) - Expect(err).ToNot(HaveOccurred(), "failed to run manager") + gomega.Expect(err).ToNot(gomega.HaveOccurred(), "failed to run manager") }() K8sClient = K8sManager.GetClient() - Expect(K8sClient).ToNot(BeNil()) + gomega.Expect(K8sClient).ToNot(gomega.BeNil()) }, 60) -var _ = AfterSuite(func() {}) +var _ = ginkgo.AfterSuite(func() {}) func TestReconcile(t *testing.T) { t.Parallel() @@ -130,9 +130,9 @@ func TestReconcile(t *testing.T) { t.Cleanup(func() { time.Sleep(5 * time.Second) Cancel() - By("tearing down the test environment") + ginkgo.By("tearing down the test environment") err = TestEnv.Stop() - Expect(err).NotTo(HaveOccurred()) + gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) }