add go.mod

This commit is contained in:
antham
2018-09-05 21:48:37 +02:00
committed by Anthony HAMON
parent ba7e6add86
commit 0d7a697e86
2 changed files with 79 additions and 5 deletions

View File

@@ -2,14 +2,23 @@ version: 2
jobs:
build:
docker:
- image: circleci/golang:1.10
- image: circleci/golang:1.11
working_directory: /go/src/github.com/jesseduffield/lazygit
steps:
- checkout
- restore_cache:
keys:
- pkg-cache-{{ checksum "Gopkg.lock" }}-v1
- run:
name: Ensure go.mod file is up to date
command: |
export GO111MODULE=on
mv go.mod /tmp/
go mod init
export GO111MODULE=auto
if [ $(diff /tmp/go.mod go.mod|wc -l) -gt 0 ]; then
diff /tmp/go.mod go.mod
exit 1;
fi
- run:
name: Run gofmt -s
command: |
@@ -17,6 +26,9 @@ jobs:
find . ! -path "./vendor/*" -name "*.go" -exec gofmt -s -d {} \;
exit 1;
fi
- restore_cache:
keys:
- pkg-cache-{{ checksum "Gopkg.lock" }}-v2
- run:
name: Run tests
command: |
@@ -31,7 +43,7 @@ jobs:
command: |
bash <(curl -s https://codecov.io/bash)
- save_cache:
key: pkg-cache-{{ checksum "Gopkg.lock" }}-v1
key: pkg-cache-{{ checksum "Gopkg.lock" }}-v2
paths:
- ~/.cache/go-build