Skip to content

Commit

Permalink
Merge pull request #146 from mallardduck/remove-build-tags
Browse files Browse the repository at this point in the history
  • Loading branch information
mallardduck authored Jan 13, 2025
2 parents a089492 + 523834d commit 0e2f8a1
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 16 deletions.
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"

0 comments on commit 0e2f8a1

Please sign in to comment.