1- ifeq ($(USE_REPO_TEST_DIR ) ,1)
2-
3- # This rule replaces the whole Makefile when we're trying to use /tmp repository temporary files
4- location = $(CURDIR ) /$(word $(words $(MAKEFILE_LIST ) ) ,$(MAKEFILE_LIST ) )
5- self := $(location )
6-
7- % :
8- @tmpdir=` mktemp --tmpdir -d` ; \
9- echo Using temporary directory $$ tmpdir for test repositories ; \
10- USE_REPO_TEST_DIR= $(MAKE ) -f $(self ) --no-print-directory REPO_TEST_DIR=$$ tmpdir/ $@ ; \
11- STATUS=$$? ; rm -r " $$ tmpdir" ; exit $$ STATUS
12-
13- else
14-
15- # This is the "normal" part of the Makefile
16-
171DIST := dist
182DIST_DIRS := $(DIST ) /binaries $(DIST ) /release
19- IMPORT := code.gitea.io/gitea
203
214# By default use go's 1.25 experimental json v2 library when building
225# TODO: remove when no longer experimental
8366
8467EXTRA_GOFLAGS ?=
8568
86- MAKE_VERSION := $(shell "$(MAKE ) " -v | cat | head -n 1)
8769MAKE_EVIDENCE_DIR := .make_evidence
8870
8971GOTESTFLAGS ?=
@@ -129,7 +111,7 @@ ifeq ($(VERSION),main)
129111 VERSION := main-nightly
130112endif
131113
132- LDFLAGS := $(LDFLAGS ) -X "main.MakeVersion= $( MAKE_VERSION ) " -X "main. Version=$(GITEA_VERSION ) " -X "main.Tags=$(TAGS ) "
114+ LDFLAGS := $(LDFLAGS ) -X "main.Version=$(GITEA_VERSION ) " -X "main.Tags=$(TAGS ) "
133115
134116LINUX_ARCHS ?= linux/amd64,linux/386,linux/arm-5,linux/arm-6,linux/arm64,linux/riscv64
135117
@@ -227,7 +209,7 @@ clean: ## delete backend and integration files
227209 e2e* .test \
228210 tests/integration/gitea-integration-* \
229211 tests/integration/indexers-* \
230- tests/mysql.ini tests/pgsql.ini tests/mssql.ini man/ \
212+ tests/sqlite.ini tests/ mysql.ini tests/pgsql.ini tests/mssql.ini man/ \
231213 tests/e2e/gitea-e2e-* / \
232214 tests/e2e/indexers-* / \
233215 tests/e2e/reports/ tests/e2e/test-artifacts/ tests/e2e/test-snapshots/
@@ -474,9 +456,8 @@ $(GO_LICENSE_FILE): go.mod go.sum
474456 GO=$(GO ) $(GO ) run build/generate-go-licenses.go $(GO_LICENSE_FILE )
475457
476458generate-ini-sqlite :
477- sed -e ' s|{{REPO_TEST_DIR }}|${REPO_TEST_DIR} |g' \
459+ sed -e ' s|{{WORK_PATH }}|$(CURDIR)/tests/$(or $(TEST_TYPE),integration)/gitea-$(or $(TEST_TYPE),integration)-sqlite |g' \
478460 -e ' s|{{TEST_LOGGER}}|$(or $(TEST_LOGGER),test$(COMMA)file)|g' \
479- -e ' s|{{TEST_TYPE}}|$(or $(TEST_TYPE),integration)|g' \
480461 tests/sqlite.ini.tmpl > tests/sqlite.ini
481462
482463.PHONY : test-sqlite
@@ -495,9 +476,8 @@ generate-ini-mysql:
495476 -e ' s|{{TEST_MYSQL_DBNAME}}|${TEST_MYSQL_DBNAME}|g' \
496477 -e ' s|{{TEST_MYSQL_USERNAME}}|${TEST_MYSQL_USERNAME}|g' \
497478 -e ' s|{{TEST_MYSQL_PASSWORD}}|${TEST_MYSQL_PASSWORD}|g' \
498- -e ' s|{{REPO_TEST_DIR }}|${REPO_TEST_DIR} |g' \
479+ -e ' s|{{WORK_PATH }}|$(CURDIR)/tests/$(or $(TEST_TYPE),integration)/gitea-$(or $(TEST_TYPE),integration)-mysql |g' \
499480 -e ' s|{{TEST_LOGGER}}|$(or $(TEST_LOGGER),test$(COMMA)file)|g' \
500- -e ' s|{{TEST_TYPE}}|$(or $(TEST_TYPE),integration)|g' \
501481 tests/mysql.ini.tmpl > tests/mysql.ini
502482
503483.PHONY : test-mysql
@@ -518,9 +498,8 @@ generate-ini-pgsql:
518498 -e ' s|{{TEST_PGSQL_PASSWORD}}|${TEST_PGSQL_PASSWORD}|g' \
519499 -e ' s|{{TEST_PGSQL_SCHEMA}}|${TEST_PGSQL_SCHEMA}|g' \
520500 -e ' s|{{TEST_MINIO_ENDPOINT}}|${TEST_MINIO_ENDPOINT}|g' \
521- -e ' s|{{REPO_TEST_DIR }}|${REPO_TEST_DIR} |g' \
501+ -e ' s|{{WORK_PATH }}|$(CURDIR)/tests/$(or $(TEST_TYPE),integration)/gitea-$(or $(TEST_TYPE),integration)-pgsql |g' \
522502 -e ' s|{{TEST_LOGGER}}|$(or $(TEST_LOGGER),test$(COMMA)file)|g' \
523- -e ' s|{{TEST_TYPE}}|$(or $(TEST_TYPE),integration)|g' \
524503 tests/pgsql.ini.tmpl > tests/pgsql.ini
525504
526505.PHONY : test-pgsql
@@ -539,9 +518,8 @@ generate-ini-mssql:
539518 -e ' s|{{TEST_MSSQL_DBNAME}}|${TEST_MSSQL_DBNAME}|g' \
540519 -e ' s|{{TEST_MSSQL_USERNAME}}|${TEST_MSSQL_USERNAME}|g' \
541520 -e ' s|{{TEST_MSSQL_PASSWORD}}|${TEST_MSSQL_PASSWORD}|g' \
542- -e ' s|{{REPO_TEST_DIR }}|${REPO_TEST_DIR} |g' \
521+ -e ' s|{{WORK_PATH }}|$(CURDIR)/tests/$(or $(TEST_TYPE),integration)/gitea-$(or $(TEST_TYPE),integration)-mssql |g' \
543522 -e ' s|{{TEST_LOGGER}}|$(or $(TEST_LOGGER),test$(COMMA)file)|g' \
544- -e ' s|{{TEST_TYPE}}|$(or $(TEST_TYPE),integration)|g' \
545523 tests/mssql.ini.tmpl > tests/mssql.ini
546524
547525.PHONY : test-mssql
@@ -662,15 +640,15 @@ migrations.sqlite.test: $(GO_SOURCES) generate-ini-sqlite
662640 GITEA_TEST_CONF=tests/sqlite.ini ./migrations.sqlite.test
663641
664642.PHONY : migrations.individual.mysql.test
665- migrations.individual.mysql.test : $(GO_SOURCES )
643+ migrations.individual.mysql.test : $(GO_SOURCES ) generate-ini-mysql
666644 GITEA_TEST_CONF=tests/mysql.ini $(GO ) test $(GOTESTFLAGS ) -tags=' $(TEST_TAGS)' -p 1 $(MIGRATE_TEST_PACKAGES )
667645
668646.PHONY : migrations.individual.sqlite.test\# %
669647migrations.individual.sqlite.test\#% : $(GO_SOURCES ) generate-ini-sqlite
670648 GITEA_TEST_CONF=tests/sqlite.ini $(GO ) test $(GOTESTFLAGS ) -tags ' $(TEST_TAGS)' code.gitea.io/gitea/models/migrations/$*
671649
672650.PHONY : migrations.individual.pgsql.test
673- migrations.individual.pgsql.test : $(GO_SOURCES )
651+ migrations.individual.pgsql.test : $(GO_SOURCES ) generate-ini-pgsql
674652 GITEA_TEST_CONF=tests/pgsql.ini $(GO ) test $(GOTESTFLAGS ) -tags=' $(TEST_TAGS)' -p 1 $(MIGRATE_TEST_PACKAGES )
675653
676654.PHONY : migrations.individual.pgsql.test\# %
@@ -901,9 +879,6 @@ docker:
901879 docker build --disable-content-trust=false -t $(DOCKER_REF ) .
902880# support also build args docker build --build-arg GITEA_VERSION=v1.2.3 --build-arg TAGS="bindata sqlite sqlite_unlock_notify" .
903881
904- # This endif closes the if at the top of the file
905- endif
906-
907882# Disable parallel execution because it would break some targets that don't
908883# specify exact dependencies like 'backend' which does currently not depend
909884# on 'frontend' to enable Node.js-less builds from source tarballs.
0 commit comments