Skip to content
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
3 changes: 3 additions & 0 deletions .github/workflows/build-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
fetch-tags: true
- name: Setup Go
uses: actions/setup-go@v5
with:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
fetch-tags: true
- name: Setup Go
uses: actions/setup-go@v5
with:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/helm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
fetch-tags: true
- name: Set up Helm
uses: azure/setup-helm@v4.3.1
with:
Expand Down
26 changes: 6 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -118,45 +118,31 @@ clean-docker: ## Clean built docker images.
@rm -f .docker
clean-all: clean clean-docker ## Clean everything.

vendor: github-config ## Update vendor libraries.
vendor: ## Update vendor libraries.
@printf "\n=== <PROCESS GO MOD> ===\n"
@go mod tidy
@go mod vendor

.PHONY: github-config
github-config:
@printf "\n=== <PROCESS GITHUB CONFIG> ===\n"
@set -ex
@if [ -z $(shell git config --global credential."https://github.com".username) ]; then \
git config --global credential."https://github.com".username "${GITHUB_USERNAME}"; \
fi
@if [ -z "$(shell git config --global credential."https://github.com".helper)" ]; then \
git config --global credential."https://github.com".helper "! f() { echo \"password=$(shell head -1 ./github-password)\"; }; f"; \
fi
@if [ "$(shell git config --global safe.directory)" != "$(CURDIR)" ]; then \
git config --global --add safe.directory "$(CURDIR)"; \
fi

include e2e.mk
.PHONY: e2e-code
e2e-code: github-config ## Run e2e tests
e2e-code: ## Run e2e tests
@printf "\n=== <PROCESS E2E TESTS> ===\n"
go clean -testcache
echo "Using ${E2E_TESTCONFIG} configset.."
go test -test.v -timeout 0 ${E2E_TESTLIST_LOCAL}

.PHONY: unit coverage job-coverage
unit: github-config ## Run go unit
unit: ## Run go unit
@printf "\n=== <PROCESS GO UNIT> ===\n"
go test -test.v -timeout 0 "./pkg/..."

coverage: github-config ## Run go coverage
coverage: ## Run go coverage
@printf "\n=== <PROCESS GO COVERAGE> ===\n"
go test -coverprofile=coverage.out "./pkg/..."
go tool cover -html=coverage.out
rm coverage.out

job-coverage: github-config ## Run go coverage and export to html file
job-coverage: ## Run go coverage and export to html file
@printf "\n=== <PROCESS GO JOB COVERAGE> ===\n"
go test -coverprofile=coverage.out "./pkg/..."
go tool cover -html=coverage.out -o coverage.html
Expand Down Expand Up @@ -235,7 +221,7 @@ fmt: vendor ## Run go fmt
@printf "\n=== <PROCESS GO FMT> ===\n"
go fmt ./pkg/... ./cmd/... ./test/...

check: github-config fmt generate lint ## Run git diff check
check: fmt generate lint ## Run git diff check

.PHONY: check-diff
check-diff:
Expand Down
2 changes: 1 addition & 1 deletion build/scripts/get_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function get_version {
if [[ "${last_tag}" == "${main_version}" ]]; then
commits_since_tag="$(_git rev-list --count "${last_tag}"..HEAD)"
if [[ "${commits_since_tag}" != "0" ]]; then
version="${echo $last_tag | sed -E "s/[0-9]+$/${commits_since_tag}/"}"
version="$(echo $last_tag | sed -E "s/[0-9]+$/${commits_since_tag}/")"
else
version="${last_tag}"
fi
Expand Down