wg-quicker/.gitlab-ci.yml

26 lines
844 B
YAML
Raw Normal View History

2019-03-27 17:26:09 +01:00
stages:
- build
go_build:
stage: build
image: golang:1.12
variables:
CGO_ENABLED: 0
2019-03-27 17:29:52 +01:00
script:
2019-03-28 16:29:16 +01:00
- mkdir -p .cache/cache || true
- mkdir -p .cache/go || true
2019-03-27 17:29:52 +01:00
- export GOCACHE="$CI_PROJECT_DIR/.cache/cache"
- export GOPATH="$CI_PROJECT_DIR/.cache/go"
2019-03-28 16:28:45 +01:00
- CGO_ENABLED=1 go test -race ./...
- mkdir -p build || true
- go env
- GOOS=linux GOARCH=amd64 go build -a -ldflags '-extldflags "-static"' -o build/${CI_PROJECT_NAME}-amd64 ./cmd/wg-quick
- GOOS=linux GOARCH=arm GOARM=7 go build -a -ldflags '-extldflags "-static"' -o build/${CI_PROJECT_NAME}-arm32v7 ./cmd/wg-quick
- GOOS=linux GOARCH=arm64 go build -a -ldflags '-extldflags "-static"' -o build/${CI_PROJECT_NAME}-arm64v8 ./cmd/wg-quick
artifacts:
paths:
- build/
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- .cache