Skip to content

Commit

Permalink
ci: Tidy up lint workflow (#939)
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmidyson authored Oct 26, 2023
1 parent 3a4969a commit 38062f3
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 34 deletions.
1 change: 0 additions & 1 deletion .github/linters/.golangci.yml

This file was deleted.

4 changes: 1 addition & 3 deletions .github/workflows/conventional-label.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ on:
- edited
jobs:
label:
runs-on:
- self-hosted
- micro
runs-on: ubuntu-22.04
steps:
- uses: bcoe/conventional-release-labels@v1
35 changes: 13 additions & 22 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ permissions:

jobs:
super-linter:
runs-on:
- self-hosted
- small
runs-on: ubuntu-22.04
steps:
- name: Checkout konvoy-image-builder repository
uses: actions/checkout@v4
Expand All @@ -34,13 +32,10 @@ jobs:
env-file: .github/super-linter.env

- name: Run Super-Linter
uses: github/super-linter@v5.0.0
uses: super-linter/super-linter@v5
env:
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# NOTE(jkoelker) super-linter is broken for go packages
# https://github.com/github/super-linter/issues/143
VALIDATE_GO: false
# NOTE(jongiddy) super-linter is broken for Packer HCL files
# https://github.com/github/super-linter/pull/1707
# This can be removed when a release > 4.2.2 exists.
Expand All @@ -49,20 +44,16 @@ jobs:
VALIDATE_NATURAL_LANGUAGE: false
# we use terraform to provision *test* infrastructure that is deleted
VALIDATE_TERRAFORM_TFLINT: false
VALIDATE_ALL_CODEBASE: ${{ github.event_name == 'pull_request' }}
golangci-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout konvoy-image-builder repository
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
cache: true
runs-on: ubuntu-22.04
steps:
- name: Checkout konvoy-image-builder repository
uses: actions/checkout@v4

- name: Run golangci lint
uses: golangci/golangci-lint-action@v3
with:
#version of golangci-lint to use with
version: latest
- name: golangci-lint
uses: reviewdog/action-golangci-lint@v2
with:
fail_on_error: true
reporter: github-pr-review
go_version_file: 'go.mod'
2 changes: 1 addition & 1 deletion .github/workflows/podman-aws-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ permissions:

jobs:
rune2e:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
continue-on-error: false
steps:
- name: Checkout konvoy-image-builder repository
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-kib.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.MESOSPHERECI_USER_TOKEN }}

bump-kib:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs: release-to-github
steps:
- name: Checkout mesosphere/cluster-api-provider-preprovisioned repository
Expand Down
3 changes: 0 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ linters:
enable:
- asciicheck
- bodyclose
- deadcode
- depguard
- dogsled
- dupl
Expand Down Expand Up @@ -100,15 +99,13 @@ linters:
- predeclared
- revive
- staticcheck
- structcheck
- stylecheck
- thelper
- tparallel
- typecheck
- unconvert
- unparam
- unused
- varcheck
- whitespace
# NOTE(jkoelker) disable wrapcheck until >1.10 is in golangci-lint
# - wrapcheck
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -421,9 +421,9 @@ export DOCKER_SUPER_LINTER_ARGS ?= \
--env-file $(REPO_ROOT_DIR)/.github/super-linter.env \
--volume $(REPO_ROOT_DIR):/tmp/lint
export DOCKER_SUPER_LINTER_VERSION ?= $(shell \
grep 'uses: github/super-linter' $(REPO_ROOT_DIR)/.github/workflows/lint.yml | cut -d@ -f2 \
grep 'uses: super-linter/super-linter' $(REPO_ROOT_DIR)/.github/workflows/lint.yml | cut -d@ -f2 \
)
export DOCKER_SUPER_LINTER_IMG := github/super-linter:$(DOCKER_SUPER_LINTER_VERSION)
export DOCKER_SUPER_LINTER_IMG := ghcr.io/super-linter/super-linter:$(DOCKER_SUPER_LINTER_VERSION)

super-lint: ## run all linting with super-linter
$(call print-target)
Expand All @@ -449,7 +449,7 @@ super-lint-shell: ## open a shell in the super-linter container
.PHONY: test
test: ## go test with race detector and code coverage
$(call print-target)
CGO_ENABLED=1 go test $(shell go list ./... | grep -v e2e) -- -race -short -v
CGO_ENABLED=1 go test $(shell go list ./... | grep -v e2e) -- -race -short -v

.PHONY: integration-test
integration-test: ## go test with race detector for integration tests
Expand Down

0 comments on commit 38062f3

Please sign in to comment.