From 50c30c8173a423059ed40d485ebc6b91b2aa852a Mon Sep 17 00:00:00 2001 From: silverwind Date: Fri, 20 Feb 2026 04:44:53 +0100 Subject: [PATCH] Add EXECUTABLE_E2E variable and proper Make target - Add EXECUTABLE_E2E variable alongside EXECUTABLE for the e2e binary - Make the e2e binary target non-phony, tracking $(GO_SOURCES) to avoid unnecessary rebuilds - Add separate make gitea-e2e step in CI for visibility Co-Authored-By: Claude Opus 4.6 --- .github/workflows/pull-e2e-tests.yml | 1 + Makefile | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull-e2e-tests.yml b/.github/workflows/pull-e2e-tests.yml index 8ea9057d2f..271b3799af 100644 --- a/.github/workflows/pull-e2e-tests.yml +++ b/.github/workflows/pull-e2e-tests.yml @@ -34,6 +34,7 @@ jobs: - run: make deps-frontend - run: make frontend - run: make deps-backend + - run: make gitea-e2e - run: make test-e2e timeout-minutes: 10 env: diff --git a/Makefile b/Makefile index 69cc048297..230a562478 100644 --- a/Makefile +++ b/Makefile @@ -53,9 +53,11 @@ endif ifeq ($(IS_WINDOWS),yes) GOFLAGS := -v -buildmode=exe EXECUTABLE ?= gitea.exe + EXECUTABLE_E2E ?= gitea-e2e.exe else GOFLAGS := -v EXECUTABLE ?= gitea + EXECUTABLE_E2E ?= gitea-e2e endif ifeq ($(shell sed --version 2>/dev/null | grep -q GNU && echo gnu),gnu) @@ -200,7 +202,7 @@ clean-all: clean ## delete backend, frontend and integration files .PHONY: clean clean: ## delete backend and integration files - rm -rf $(EXECUTABLE) gitea-e2e $(DIST) $(BINDATA_DEST_WILDCARD) \ + rm -rf $(EXECUTABLE) $(EXECUTABLE_E2E) $(DIST) $(BINDATA_DEST_WILDCARD) \ integrations*.test \ tests/integration/gitea-integration-* \ tests/integration/indexers-* \ @@ -534,9 +536,8 @@ playwright: deps-frontend @$(NODE_VARS) pnpm exec playwright install $(if $(GITHUB_ACTIONS),,--with-deps) chromium $(if $(CI),firefox) $(PLAYWRIGHT_FLAGS) .PHONY: test-e2e -test-e2e: playwright - @CGO_ENABLED=1 $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TEST_TAGS)' -ldflags '-s -w $(EXTLDFLAGS) $(LDFLAGS)' -o gitea-e2e - @EXECUTABLE=gitea-e2e ./tools/test-e2e.sh $(GITEA_TEST_E2E_FLAGS) +test-e2e: playwright $(EXECUTABLE_E2E) + @EXECUTABLE=$(EXECUTABLE_E2E) ./tools/test-e2e.sh $(GITEA_TEST_E2E_FLAGS) .PHONY: bench-sqlite bench-sqlite: integrations.sqlite.test generate-ini-sqlite @@ -670,6 +671,9 @@ ifneq ($(and $(STATIC),$(findstring pam,$(TAGS))),) endif CGO_ENABLED="$(CGO_ENABLED)" CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '-s -w $(EXTLDFLAGS) $(LDFLAGS)' -o $@ +$(EXECUTABLE_E2E): $(GO_SOURCES) + CGO_ENABLED=1 $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TEST_TAGS)' -ldflags '-s -w $(EXTLDFLAGS) $(LDFLAGS)' -o $@ + .PHONY: release release: frontend generate release-windows release-linux release-darwin release-freebsd release-copy release-compress vendor release-sources release-check