magnetico/.travis.yml

57 lines
1.9 KiB
YAML
Raw Normal View History

2018-08-07 09:30:23 +02:00
# https://docs.travis-ci.com/user/reference/overview/#virtualisation-environment-vs-operating-system
2018-08-03 10:51:20 +02:00
sudo: false
2018-08-07 09:30:23 +02:00
dist: trusty
2018-08-03 10:51:20 +02:00
language: go
go:
2018-08-03 10:51:20 +02:00
- "1.10"
2018-08-03 10:51:20 +02:00
# Only clone the most recent commit.
git:
depth: 1
2018-08-03 10:51:20 +02:00
env:
- DEP_VERSION="0.5.0"
before_install:
2018-08-03 11:54:26 +02:00
# Dump environment variables
- printenv
2018-08-03 10:51:20 +02:00
# Download the binary to bin folder in $GOPATH
- curl -L -s https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 -o $GOPATH/bin/dep
# Make the binary executable
- chmod +x $GOPATH/bin/dep
install:
2018-08-03 11:23:00 +02:00
- "go get -u github.com/jteeuwen/go-bindata/..."
- "dep ensure"
before_script:
- "go-bindata
2018-08-03 11:54:26 +02:00
-o=\"${GOPATH}/src/github.com/boramalper/magnetico/cmd/magneticow/bindata.go\"
-prefix=\"${GOPATH}/src/github.com/boramalper/magnetico/cmd/magneticow/data/\"
${GOPATH}/src/github.com/boramalper/magnetico/cmd/magneticow/data/..."
script:
2018-08-03 10:51:20 +02:00
# The Unit Tests
- "go test github.com/boramalper/magnetico/cmd/magneticod/..."
- "go test github.com/boramalper/magnetico/cmd/magneticow/..."
- "go test github.com/boramalper/magnetico/pkg/persistence/..."
# Static Analysis (vet)
- "go vet github.com/boramalper/magnetico/cmd/magneticod/..."
- "go vet github.com/boramalper/magnetico/cmd/magneticow/..."
- "go vet github.com/boramalper/magnetico/pkg/persistence/..."
# Formatting Errors
2018-08-03 12:11:36 +02:00
#
# Since gofmt returns zero even if there are files to be formatted, we use:
#
# ! gofmt -d ${GOPATH}/path/ 2>&1 | read
#
# to return 1 if there are files to be formatted, and 0 if not.
#
# https://groups.google.com/forum/#!topic/Golang-Nuts/pdrN4zleUio
- "! gofmt -l ${GOPATH}/src/github.com/boramalper/magnetico/cmd/magneticod/ 2>&1 | read"
- "! gofmt -l ${GOPATH}/src/github.com/boramalper/magnetico/cmd/magneticow/ 2>&1 | read"
- "! gofmt -l ${GOPATH}/src/github.com/boramalper/magnetico/pkg/persistence/ 2>&1 | read"