diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e174d62..e681d3b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,10 +25,6 @@ jobs: - name: Run integration tests run: make test-integration - # Note: makefile stages: build/install/kind-setup/test-integration-cmd - - name: Run integration tests for cmd - run: make test-integration-cmd - - name: Run GoReleaser uses: goreleaser/goreleaser-action@v6 with: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..d1af58b --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,40 @@ +name: Lint +on: + push: + branches: + - master + - "release/**" + pull_request: + branches: + - master + - "release/**" + types: + - opened + - reopened + - synchronize + - ready_for_review + workflow_dispatch: + +jobs: + lint: + if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-go@v5 + with: + go-version-file: go.mod + + - name: Install golangci-lint + if: runner.os == 'Linux' + uses: golangci/golangci-lint-action@v6 + with: + version: v1.62.2 + skip-cache: true + + - name: Lint + if: runner.os == 'Linux' + run: make lint diff --git a/Makefile b/Makefile index 4c626e8..9a5d116 100644 --- a/Makefile +++ b/Makefile @@ -47,11 +47,6 @@ kind-teardown: .PHONY: test-integration test-integration: install kind-setup KUBECTL_ENVSUBST_INTEGRATION_TESTS_AVAILABLE=0xcafebabe go test -v integration/*.go - $(MAKE) kind-teardown - -# Run integration tests for the 'main' function -.PHONY: test-integration-cmd -test-integration-cmd: install kind-setup KUBECTL_ENVSUBST_INTEGRATION_TESTS_AVAILABLE=0xcafebabe go test -v cmd/app/*.go $(MAKE) kind-teardown