From 95edf678f4a46f31f4db3ef2a810ed0fbafc5cd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Correa=20G=C3=B3mez?= Date: Fri, 6 Jun 2025 16:38:02 +0200 Subject: [PATCH] ci: upload test report to CI To make it possible, tweak a bit the Makefile Part-of: https://gitlab.postmarketos.org/postmarketOS/postmarketos-mkinitfs/-/merge_requests/63 --- .gitlab-ci.yml | 6 +++++- Makefile | 7 ++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8880cc9..62643bc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,13 +20,17 @@ workflow: build: stage: build + variables: + GOTEST: "gotestsum --junitfile report.xml --format testname -- ./..." before_script: - - apk -q add go staticcheck make scdoc + - apk -q add go gotestsum staticcheck make scdoc script: - make test - make artifacts: expire_in: 1 week + reports: + junit: report.xml vendor: stage: vendor diff --git a/Makefile b/Makefile index 0b1e841..a083548 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,8 @@ GO?=go GOFLAGS?= LDFLAGS+=-s -w -X main.Version=$(VERSION) RM?=rm -f -GOTEST=go test -count=1 -race +GOTESTOPTS?=-count=1 -race +GOTEST?=go test ./... DISABLE_GOGC?= ifeq ($(DISABLE_GOGC),1) @@ -47,10 +48,10 @@ test: fi @staticcheck ./... - @$(GOTEST) ./... + $(GOTEST) $(GOTESTOPTS) clean: - $(RM) mkinitfs $(DOCS) + $(RM) mkinitfs $(DOCS) $(RM) $(VENDORED)* install: $(DOCS) mkinitfs