-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path.gitlab-ci.yml
42 lines (37 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
variables:
GOPROJ: "github.com/RaveNoX/go-jsonmerge"
stages:
- test
- build
test:
tags:
- docker
- linux
image: golang:latest
stage: test
script:
- mkdir -p artifacts
- go test -cover -v -coverprofile="./artifacts/cover.out" ./
- go tool cover -html="./artifacts/cover.out" -o "./artifacts/cover.htm"
- go test -cover -v -coverprofile="./artifacts/cover_cmd.out" ./cmd/jsonmerge
- go tool cover -html="./artifacts/cover_cmd.out" -o "./artifacts/cover_cmd.htm"
artifacts:
paths:
- artifacts/*
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/jsonmerge ./cmd/jsonmerge
- echo "Building for MacOS (darwin)"
- GOOS=darwin GOARCH=amd64 go build -o artifacts/jsonmerge_darwin ./cmd/jsonmerge
- echo "Building for Windows"
- GOOS=windows GOARCH=amd64 go build -o artifacts/jsonmerge.exe ./cmd/jsonmerge
artifacts:
paths:
- artifacts/*