diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fc03200..eea7880 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,19 +6,33 @@ stages: variables: CGO_ENABLED: 0 -test:unit: +test:junit: artifacts: - expire_in: 30 minutes - paths: - - code-coverage.html + expire_in: 1 hour reports: junit: report.xml before_script: - apk add --no-cache make - go get -u github.com/jstemmer/go-junit-report + except: + - master image: golang:1.13.6-alpine script: + - make test_junit_report + stage: test + +test:unit: + artifacts: + expire_in: 30 minutes + paths: + - code-coverage.html + before_script: + - apk add --no-cache make + image: golang:1.13.6-alpine + only: + - master@dananglin/pominal + script: - make test_cover_report stage: test @@ -30,8 +44,7 @@ pages: dependencies: - test:unit only: - refs: - - master@dananglin/pominal + - master@dananglin/pominal script: - mkdir public - mv code-coverage.html public diff --git a/Makefile b/Makefile index 920f706..89bcba1 100644 --- a/Makefile +++ b/Makefile @@ -6,8 +6,11 @@ BIN_FILE := $(BIN_DIR)/$(NAME) all: test_unit build +test_junit_report: + @go test -v . 2>&1 | go-junit-report > report.xml + test_unit: - @go test -v -coverprofile=cover.out . 2>&1 | go-junit-report > report.xml + @go test -v -coverprofile=cover.out . test_cover_report: test_unit @go tool cover -html=cover.out -o code-coverage.html