From 3565dce0c4cb65a1b48327a58d104cae66bc4d6d Mon Sep 17 00:00:00 2001 From: Francisc Munteanu Date: Thu, 4 Apr 2024 12:03:29 +0200 Subject: [PATCH 1/2] fix linter (#383) --- controllers/label_event_handler_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/label_event_handler_test.go b/controllers/label_event_handler_test.go index 28eccaa6..cf414892 100644 --- a/controllers/label_event_handler_test.go +++ b/controllers/label_event_handler_test.go @@ -121,7 +121,7 @@ func TestMapToControllerByMatchingLabel(t *testing.T) { t.Run("resource without labels", func(t *testing.T) { // given objMeta := metav1.ObjectMeta{ - Name: "bar", + Name: "bar", Labels: nil, } obj := corev1.Namespace{ From 6b578e14b2620eaba9a727e02de8892b18c97ff6 Mon Sep 17 00:00:00 2001 From: Feny Mehta Date: Thu, 4 Apr 2024 15:57:43 +0530 Subject: [PATCH 2/2] Split ci-build.yml (#382) Signed-off-by: Feny Mehta Co-authored-by: Francisc Munteanu --- .github/workflows/linters.yml | 31 +++++++++++++++++++ .../{ci-build.yml => test-with-coverage.yml} | 20 ------------ 2 files changed, 31 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/linters.yml rename .github/workflows/{ci-build.yml => test-with-coverage.yml} (68%) diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml new file mode 100644 index 00000000..152a4dc3 --- /dev/null +++ b/.github/workflows/linters.yml @@ -0,0 +1,31 @@ +name: ci-build +on: + push: + branches: + - master + tags-ignore: + - '*.*' + pull_request: + branches: + - master + +jobs: + golangci: + name: GolangCI Lint + runs-on: ubuntu-20.04 + steps: + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: 1.20.x + + - name: Checkout code + uses: actions/checkout@v4 + + - name: Lint + uses: golangci/golangci-lint-action@v4 + with: + version: v1.52.0 + skip-pkg-cache: true + skip-build-cache: true + args: --config=./.golangci.yml --verbose \ No newline at end of file diff --git a/.github/workflows/ci-build.yml b/.github/workflows/test-with-coverage.yml similarity index 68% rename from .github/workflows/ci-build.yml rename to .github/workflows/test-with-coverage.yml index 27bf5265..5e8ea95e 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/test-with-coverage.yml @@ -38,23 +38,3 @@ jobs: flags: unittests # optional fail_ci_if_error: true # optional (default = false) verbose: true # optional (default = false) - - golangci: - name: GolangCI Lint - runs-on: ubuntu-20.04 - steps: - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: 1.20.x - - - name: Checkout code - uses: actions/checkout@v4 - - - name: Lint - uses: golangci/golangci-lint-action@v4 - with: - version: v1.52.0 - skip-pkg-cache: true - skip-build-cache: true - args: --config=./.golangci.yml --verbose