2018-08-16 14:07:02 +02:00
|
|
|
version: 2
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
docker:
|
2019-03-05 12:51:40 +02:00
|
|
|
- image: circleci/golang:1.12
|
2019-08-26 17:22:01 +02:00
|
|
|
environment:
|
|
|
|
GO111MODULE: "on"
|
2018-08-18 09:27:47 +02:00
|
|
|
working_directory: /go/src/github.com/jesseduffield/lazygit
|
|
|
|
steps:
|
|
|
|
- checkout
|
2018-08-26 02:17:46 +02:00
|
|
|
- run:
|
|
|
|
name: Run gofmt -s
|
|
|
|
command: |
|
|
|
|
if [ $(find . ! -path "./vendor/*" -name "*.go" -exec gofmt -s -d {} \;|wc -l) -gt 0 ]; then
|
|
|
|
find . ! -path "./vendor/*" -name "*.go" -exec gofmt -s -d {} \;
|
|
|
|
exit 1;
|
|
|
|
fi
|
2018-09-05 21:48:37 +02:00
|
|
|
- restore_cache:
|
|
|
|
keys:
|
2019-08-26 17:22:01 +02:00
|
|
|
- pkg-cache-{{ checksum "go.sum" }}-v5
|
2018-08-18 09:27:47 +02:00
|
|
|
- run:
|
|
|
|
name: Run tests
|
|
|
|
command: |
|
|
|
|
./test.sh
|
2019-03-23 02:56:39 +02:00
|
|
|
- run:
|
|
|
|
name: Push on codecov result
|
|
|
|
command: |
|
|
|
|
bash <(curl -s https://codecov.io/bash)
|
2018-08-25 15:32:06 +02:00
|
|
|
- run:
|
|
|
|
name: Compile project on every platform
|
|
|
|
command: |
|
|
|
|
go get github.com/mitchellh/gox
|
2019-08-26 17:22:01 +02:00
|
|
|
gox -mod=vendor -parallel 10 -os "linux freebsd netbsd windows" -osarch "darwin/i386 darwin/amd64"
|
2018-08-25 21:45:05 +02:00
|
|
|
- save_cache:
|
2019-08-26 17:22:01 +02:00
|
|
|
key: pkg-cache-{{ checksum "go.sum" }}-v5
|
2018-08-25 21:45:05 +02:00
|
|
|
paths:
|
2018-09-04 22:23:17 +02:00
|
|
|
- ~/.cache/go-build
|
2018-08-16 14:07:02 +02:00
|
|
|
|
2018-08-18 09:27:47 +02:00
|
|
|
release:
|
|
|
|
docker:
|
2019-08-26 17:22:01 +02:00
|
|
|
- image: circleci/golang:1.12
|
2018-08-16 14:07:02 +02:00
|
|
|
working_directory: /go/src/github.com/jesseduffield/lazygit
|
|
|
|
steps:
|
|
|
|
- checkout
|
2018-08-18 09:27:47 +02:00
|
|
|
- run:
|
|
|
|
name: Run gorelease
|
|
|
|
command: |
|
|
|
|
curl -sL https://git.io/goreleaser | bash
|
2018-08-16 14:07:02 +02:00
|
|
|
|
2018-08-18 09:27:47 +02:00
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
build:
|
|
|
|
jobs:
|
|
|
|
- build
|
|
|
|
release:
|
|
|
|
jobs:
|
|
|
|
- release:
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /v[0-9]+(\.[0-9]+)*/
|
|
|
|
branches:
|
|
|
|
ignore: /.*/
|