1
0
Fork 0
mirror of https://github.com/shouptech/tempgopher.git synced 2026-02-03 08:39:43 +00:00
tempgopher/.gitlab-ci.yml
2018-10-26 13:42:04 -06:00

40 lines
828 B
YAML

image: golang:1.11
variables:
binary_name: tempgopher
project_prefix: gitlab.com/shouptech
project_path: $project_prefix/tempgopher
stages:
- test
- build
before_script:
- mkdir -p ${GOPATH}/src/${project_prefix}
- cp -r ${CI_PROJECT_DIR} ${GOPATH}/src/${project_path}
- cd ${GOPATH}/src/${project_path}
- go get -v ./...
test:
stage: test
variables:
GIN_MODE: debug
script:
- go get -v -t ./...
- go test -v -coverprofile=$CI_PROJECT_DIR/coverage.out
artifacts:
paths:
- coverage.out
build:
stage: build
variables:
build_binary: $CI_PROJECT_DIR/${binary_name}
script:
- go get -v github.com/gobuffalo/packr/...
- GOOS=linux GOARCH=arm GOARM=6 packr build -v -a -ldflags '-s -w -extldflags "-static"' -o ${build_binary}
artifacts:
paths:
- tempgopher
- install.sh