1
0
Fork 0

run go tests

This commit is contained in:
Sean Sube 2018-03-31 09:52:12 -05:00
parent e4024e4d8c
commit 20fcbce330
2 changed files with 32 additions and 3 deletions

View File

@ -4,12 +4,15 @@ stages:
- test - test
- package - package
build:go: .go: &go-job
stage: build
image: andrexus/golang-dep image: andrexus/golang-dep
tags: tags:
- runner:k8s - runner:k8s
build:go:
<<: *go-job
stage: build
script: script:
- time dep ensure - time dep ensure
- go build - go build
@ -22,7 +25,23 @@ build:go:
expire_in: 1 hour expire_in: 1 hour
cache: cache:
key: "${CI_COMMIT_REF_SLUG}" key: "${CI_COMMIT_REF_SLUG}"
untracked: true policy: pull-push
paths:
- vendor
test:go:
<<: *go-job
stage: test
cache:
key: "${CI_COMMIT_REF_SLUG}"
policy: pull
dependencies:
- build:go
script:
- go test
variables:
GOPATH: /build
package:docker: package:docker:
stage: package stage: package

10
main_test.go Normal file
View File

@ -0,0 +1,10 @@
package main
import (
"fmt"
"testing"
)
func TestSomething(t *testing.T) {
fmt.Println("hello")
}