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

Improve build process for VEXing #146

Merged
merged 6 commits into from
Jan 13, 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
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
helm version
rm get_helm.sh
- name: Package helm chart
run : ./scripts/build-chart
run : ./scripts/build-chart && BUILD_TARGET=helm-project-operator ./scripts/build-chart
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
Expand Down
2 changes: 0 additions & 2 deletions cmd/helm-locker/main.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//go:build helm_locker

package main

import (
Expand Down
4 changes: 1 addition & 3 deletions cmd/helm-project-operator/main.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//go:build helm_project_operator

package main

import (
Expand Down Expand Up @@ -36,7 +34,7 @@ var (
base64TgzChart string

debugConfig command.DebugConfig
updateCRDs bool = false
updateCRDs = false
)

type DummyOperator struct {
Expand Down
4 changes: 1 addition & 3 deletions cmd/prometheus-federator/main.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//go:build prometheus_federator

package main

import (
Expand Down Expand Up @@ -37,7 +35,7 @@ var (
base64TgzChart string

debugConfig command.DebugConfig
updateCRDs bool = false
updateCRDs = false
)

type PrometheusFederator struct {
Expand Down
2 changes: 1 addition & 1 deletion scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -e

source $(dirname $0)/version
BUILD_CMD_TARGET=${BUILD_CMD_TARGET:-"./cmd/${BUILD_TARGET}/main.go"}
BUILD_CMD_TARGET=${BUILD_CMD_TARGET:-"./cmd/${BUILD_TARGET}/"}

cd $(dirname $0)/..

Expand Down
9 changes: 6 additions & 3 deletions scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ cd $(dirname $0)/..

echo "Starating tests"

TARGET_TEST_TAG="${BUILD_TARGET/-/_}"
echo "Running tests for ${BUILD_TARGET}"

echo "Running tests for ${TARGET_TEST_TAG}"
go test -cover -tags="test,${TARGET_TEST_TAG}" ./...
PKG_LIST=$(go list "./cmd/${BUILD_TARGET}/...")
ALL_PKG_LIST=$(go list ./pkg/...)
COMBINED_LIST="$PKG_LIST $ALL_PKG_LIST"

go test -cover $COMBINED_LIST
12 changes: 9 additions & 3 deletions scripts/validate
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
#!/usr/bin/env bash
set -e

source $(dirname $0)/version
cd $(dirname $0)/..

echo "Running validation"
PACKAGES="$(go list ./...)"
echo Running: go fmt
test -z "$(go fmt ${PACKAGES} | tee /dev/stderr)"

echo "Collecting packages to validate for target: ${BUILD_TARGET}"
PKG_LIST=$(go list "./cmd/${BUILD_TARGET}/...")
ALL_PKG_LIST=$(go list ./pkg/...)
COMBINED_LIST="$PKG_LIST $ALL_PKG_LIST"

echo "Running: go fmt"
test -z "$(go fmt ${COMBINED_LIST} | tee /dev/stderr)"
echo "Validate passed"
Loading