custom travis build script

Based on https://github.com/daaku/go.travis/blob/master/install
This commit is contained in:
Taylor Gerring 2014-11-15 17:45:08 -06:00
parent 8f9a354682
commit 6f7f570670
2 changed files with 24 additions and 2 deletions

View File

@ -1,16 +1,17 @@
before_install: sudo apt-get install libgmp3-dev
install:
- go get code.google.com/p/go.net/websocket
- go get code.google.com/p/go.tools/cmd/goimports
- go get github.com/golang/lint/golint
- go get code.google.com/p/go.tools/cmd/vet
language: go
go:
- 1.3
before_script:
after_script:
# - gofmt -l -w .
# - goimports -l -w .
# - golint .
# - go vet ./...
# - go test -race ./...
- ./gocoverage.sh
script:
- curl https://raw.github.com/ethereum/go-ethereum/master/travis.sh | sh

21
travis.sh Normal file
View File

@ -0,0 +1,21 @@
#!/bin/bash
set -e
REPO_DIR=$PWD
GITHUB_REPO=$(basename $PWD)
GITHUB_USER=$(basename $(cd .. && pwd))
export GOPATH=/tmp/$GITHUB_USER/$GITHUB_REPO.$PPID
mkdir -p $GOPATH/src/github.com/$GITHUB_USER
cp -r $REPO_DIR $GOPATH/src/github.com/$GITHUB_USER/$GITHUB_REPO
echo Fetching package dependicies
go get -race github.com/$GITHUB_USER/$GITHUB_REPO/...
echo Fetching test dependicies
TEST_DEPS=$(go list -f '{{.TestImports}} {{.XTestImports}}' github.com/$GITHUB_USER/$GITHUB_REPO/... | sed -e 's/\[//g' | sed -e 's/\]//g')
if [ "$TEST_DEPS" ]; then
go get -race $TEST_DEPS
fi
# echo Building test dependicies
# go test -race -i github.com/$GITHUB_USER/$GITHUB_REPO/...
# echo Running tests
# go test -race -cpu=1,2,4 -v github.com/$GITHUB_USER/$GITHUB_REPO/...