-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
44 lines (40 loc) · 1.09 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
39
40
41
42
43
44
variables:
GOPROJ: "github.com/RaveNoX/go-jsoncommentstrip"
stages:
- test
- build
format:
tags:
- docker
- linux
image: golang:latest
stage: test
script:
- go get -u golang.org/x/tools/cmd/goimports
# If formatted is different than committed, exit with error
- (if [ "$(goimports -l ./)" == "" ]; then echo "Good format"; else echo "Bad format"; exit 33; fi);
test:
tags:
- docker
- linux
image: golang:latest
stage: test
script:
- go test -cover -v ./...
build:
stage: build
tags:
- docker
- linux
image: golang:latest
script:
- mkdir -p artifacts
- echo "Building for Linux"
- GOOS=linux GOARCH=amd64 go build -o artifacts/jsoncommentstrip ./cmd/jsoncommentstrip
- echo "Building for MacOS (darwin)"
- GOOS=darwin GOARCH=amd64 go build -o artifacts/jsoncommentstrip_darwin ./cmd/jsoncommentstrip
- echo "Building for Windows"
- GOOS=windows GOARCH=amd64 go build -o artifacts/jsoncommentstrip.exe ./cmd/jsoncommentstrip
artifacts:
paths:
- artifacts/*