ci: global GOFLAGS with -mod=vendor

This commit is contained in:
Dawid Dziurla 2019-09-15 12:10:13 +02:00
parent 817fb5349b
commit 939305ff5a
No known key found for this signature in database
GPG key ID: 7B6D8368172E9B0B

View file

@ -1,5 +1,9 @@
version: 2 version: 2
env-shared: &env-shared
environment:
GOFLAGS: "-mod=vendor"
build-shared: &build-shared build-shared: &build-shared
steps: steps:
- checkout - checkout
@ -16,12 +20,12 @@ build-shared: &build-shared
- run: - run:
name: Run tests name: Run tests
command: | command: |
go test -v -mod=vendor ./... go test -v ./...
- run: - run:
name: Compile project on every platform name: Compile project on every platform
command: | command: |
go get github.com/mitchellh/gox go get github.com/mitchellh/gox
GOFLAGS=-mod=vendor gox -parallel 10 -os "linux freebsd" -osarch "darwin/i386 darwin/amd64" gox -parallel 10 -os "linux freebsd" -osarch "darwin/i386 darwin/amd64"
- save_cache: - save_cache:
key: pkg-cache-{{ checksum "go.sum" }}-v5 key: pkg-cache-{{ checksum "go.sum" }}-v5
paths: paths:
@ -29,14 +33,17 @@ build-shared: &build-shared
jobs: jobs:
"golang:1.12": "golang:1.12":
<<: *env-shared
<<: *build-shared <<: *build-shared
docker: docker:
- image: circleci/golang:1.12 - image: circleci/golang:1.12
"golang:latest": "golang:latest":
<<: *env-shared
<<: *build-shared <<: *build-shared
docker: docker:
- image: circleci/golang:latest - image: circleci/golang:latest
release: release:
<<: *env-shared
docker: docker:
- image: circleci/golang:1.12 - image: circleci/golang:1.12
steps: steps: