Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleancode (ci, makefile, lint) #19

Merged
merged 2 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -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
5 changes: 0 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down