Skip to content

Commit

Permalink
chore: update gh-action versions
Browse files Browse the repository at this point in the history
Signed-off-by: dntosas <[email protected]>
  • Loading branch information
dntosas committed Jul 17, 2024
1 parent ac5dd10 commit 9ace19d
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 28 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/go-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/helm-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down Expand Up @@ -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.
Expand Down
34 changes: 17 additions & 17 deletions controllers/capi2argo_reconciler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -32,47 +32,47 @@ 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(),
Log: TestLog,
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()
Expand Down Expand Up @@ -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())
})
}

Expand Down

0 comments on commit 9ace19d

Please sign in to comment.