add test code

This commit is contained in:
2022-09-19 07:47:09 +07:00
parent 8de7cef179
commit cda2e7a2bc
4 changed files with 45 additions and 0 deletions

View File

@@ -15,6 +15,7 @@ variables:
stages:
- build
- test
- push
- artifacts
- release
@@ -26,6 +27,16 @@ stages:
when: never
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
test_code:
stage: test
image: golang:latest
<<: *rules
script:
- cd app
- CGO_ENABLED=0 GOOS=linux GO111MODULE=auto go test
tags:
- docker
build_main:
stage: build
image: golang:latest