-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
38 lines (35 loc) · 1.05 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
stages:
- test
- build
cache:
paths:
- /$GOPATH/src/github.com
- /$GOPATH/src/golang.org
- /$GOPATH/src/gopkg.in
api_unit_tests:
stage: test
image: golang
before_script:
- mkdir -p $GOPATH/src/$REPO/$GROUP $GOPATH/src/_/builds
- cp -r $CI_PROJECT_DIR $GOPATH/src/$REPO/$GROUP/$PROJECT
- ln -s $GOPATH/src/$REPO/$GROUP $GOPATH/src/_/builds/$GROUP
- go get -v -d -t ./...
script:
- go test -v ./api -coverprofile .goCoverage.txt
api_build:
stage: build
image: golang
before_script:
- mkdir -p $GOPATH/src/$REPO/$GROUP $GOPATH/src/_/builds
- cp -r $CI_PROJECT_DIR $GOPATH/src/$REPO/$GROUP/$PROJECT
- ln -s $GOPATH/src/$REPO/$GROUP $GOPATH/src/_/builds/$GROUP
- go get -v -d ./...
- ls
script:
- cd api
- env GOOS=linux GOARCH=amd64 go build -o output-amd64
- env GOOS=linux GOARCH=arm GOARM=7 go build -o output-pi3
artifacts:
paths:
- api/output-amd64
- api/output-pi3