diff options
author | antham <hamonanth@gmail.com> | 2018-09-05 21:48:37 +0200 |
---|---|---|
committer | Anthony HAMON <hamon.anth@gmail.com> | 2018-09-07 21:35:04 +0200 |
commit | 0d7a697e863310cdc3edc50cad5d02e54a349604 (patch) | |
tree | a69f29430206f6ca3bbc539939011c74a2bf149e /.circleci | |
parent | ba7e6add8690de21239cd0f37ee52a7c50236518 (diff) |
add go.mod
Diffstat (limited to '.circleci')
-rw-r--r-- | .circleci/config.yml | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/.circleci/config.yml b/.circleci/config.yml index 2723c13cc..46dc0d161 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 |