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

Cleanup and prepare Openshift CI #9

Merged
merged 4 commits into from
Jul 26, 2023
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 4 additions & 0 deletions .ci-operator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
build_root_image:
namespace: openshift
name: release
tag: rhel-8-release-golang-1.20-openshift-4.14
12 changes: 6 additions & 6 deletions .github/workflows/pre-submit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ jobs: # jobs to run
with:
fetch-depth: 0

- name: Verify imports are sorted
run: make test-imports
- name: Build
run: make build

- name: Verify there are no packages to vendor
run: make verify-vendor
- name: Run all linters etc.
run: make lint

- name: Run checks and unit tests
run: make check
- name: Run unit tests
run: make test
30 changes: 15 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,24 @@ rm -rf $$TMP_DIR ;\
}
endef

.PHONY: build
build: ## Build.
go build ./...

.PHONY: test
test: ## Run tests.
test: ## Run unit tests.
go test ./... -coverprofile cover.out -v

.PHONY: lint
lint: tidy goimports fix-imports vet verify-no-changes ## Run linters etc.

.PHONY: check
check: fmt vet goimports verify-no-changes ## Dockerized version of make test with additional verifications
$(DOCKER_GO) "make test"
check: ## Dockerized version of make test with additional verifications
$(DOCKER_GO) "make lint test"

.PHONY: fmt
fmt: ## Run go fmt against code.
go fmt ./...
.PHONY: goimports
goimports: install-goimports ## Run go fmt against code.
$(GOIMPORTS) -w ./pkg

.PHONY: vet
vet: ## Run go vet against code.
Expand All @@ -49,17 +56,10 @@ vet: ## Run go vet against code.
verify-no-changes: ## verify there are no un-staged changes
./hack/verify-diff.sh

.PHONY:vendor
Copy link
Member

@mshitrit mshitrit Jul 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is vendoring happens in a different job now ?
(I assume it should, but I couldn't figure out where)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed vendoring completely, doesn't make sense for a library. See PR description and commit messages. The using component vendors everything.

vendor: ## Runs go mod vendor
go mod vendor

.PHONY: tidy
tidy: ## Runs go mod tidy
go mod tidy

.PHONY:verify-vendor
verify-vendor:tidy vendor verify-no-changes ##Verifies vendor and tidy didn't cause changes

SORT_IMPORTS = $(shell pwd)/bin/sort-imports
.PHONY: sort-imports
sort-imports: ## Download sort-imports locally if necessary.
Expand All @@ -74,6 +74,6 @@ fix-imports: sort-imports ## Sort imports
$(SORT_IMPORTS) . -w

GOIMPORTS = $(shell pwd)/bin/goimports
goimports: ## updates goimports.
.PHONY: install-goimports
install-goimports: ## updates goimports.
$(call go-install-tool,$(GOIMPORTS),golang.org/x/tools/cmd/goimports@$(GOIMPORTS_VERSION))
$(GOIMPORTS) -w ./pkg
20 changes: 0 additions & 20 deletions vendor/github.com/beorn7/perks/LICENSE

This file was deleted.

Loading