Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

Commit

Permalink
fix: go builds
Browse files Browse the repository at this point in the history
Signed-off-by: András Jáky <[email protected]>

ci: fix?

Signed-off-by: András Jáky <[email protected]>
  • Loading branch information
akijakya committed Feb 23, 2024
1 parent d4d250f commit 9967785
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-and-push-component.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ jobs:
VERSION: ${{ inputs.image_tag }}
BUILD_TIMESTAMP: ${{ inputs.timestamp }}
COMMIT_HASH: ${{ github.sha }}
BUILD_OPTS: -tags=exclude_graphdriver_btrfs,exclude_graphdriver_devicemapper

- name: Export digest
if: inputs.push
Expand Down
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
run:
timeout: 20m
build-tags:
- exclude_graphdriver_btrfs
- exclude_graphdriver_devicemapper

linters-settings:
golint:
Expand Down
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ DOCKER_TAG ?= $(VERSION)
VMCLARITY_TOOLS_BASE ?=
GO_VERSION ?= $(shell cat $(ROOT_DIR)/.go-version)
GO_BUILD_TAGS ?=
GO_BUILD_TAGS += exclude_graphdriver_btrfs exclude_graphdriver_devicemapper

####
## Runtime variables
Expand Down Expand Up @@ -59,9 +60,7 @@ build: ui build-all-go ## Build all components
build-all-go: bin/vmclarity-apiserver bin/vmclarity-cli bin/vmclarity-orchestrator bin/vmclarity-ui-backend bin/vmclarity-cr-discovery-server ## Build all go components

BUILD_OPTS = -race
ifneq ($(GO_BUILD_TAGS),)
BUILD_OPTS += -tags $(GO_BUILD_TAGS)
endif
BUILD_OPTS += -tags="$(GO_BUILD_TAGS)"

LDFLAGS = -s -w
LDFLAGS += -X 'github.com/openclarity/vmclarity/core/version.Version=$(VERSION)'
Expand Down Expand Up @@ -207,6 +206,7 @@ lint-helm: ## Lint Helm charts
docker run --rm --workdir /workdir --volume "$(ROOT_DIR):/workdir" quay.io/helmpack/chart-testing:v3.8.0 ct lint --all

GOTEST_OPTS := -failfast -timeout 30m -short
GOTEST_OPTS += -tags="$(GO_BUILD_TAGS)"
ifeq ($(CI),true)
GOTEST_OPTS += -v
endif
Expand All @@ -219,10 +219,11 @@ $(TESTGOMODULES):
.PHONY: test
test: $(TESTGOMODULES) ## Run Go unit tests

GOVET_OPTS := -tags="$(GO_BUILD_TAGS)"
VETGOMODULES = $(addprefix vet-, $(GOMODULES))

$(VETGOMODULES):
go -C $(@:vet-%=%) vet ./...
go -C $(@:vet-%=%) vet $(GOVET_OPTS) ./...

.PHONY: vet
vet: $(VETGOMODULES) ## Run go vet for modules
Expand Down

0 comments on commit 9967785

Please sign in to comment.