Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
petemoore committed Aug 1, 2016
1 parent ebb8c41 commit a2f1382
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
31 changes: 16 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
language: go
go:
- 1.5
- 1.6

env:
- "GIMME_OS=linux GIMME_ARCH=386"
- "GIMME_OS=darwin GIMME_ARCH=386"
- "GIMME_OS=windows GIMME_ARCH=386"
- "GIMME_OS=linux GIMME_ARCH=amd64"
- "GIMME_OS=darwin GIMME_ARCH=amd64"
- "GIMME_OS=windows GIMME_ARCH=amd64"
- "MY_GOOS=linux MY_GOARCH=386"
- "MY_GOOS=darwin MY_GOARCH=386"
- "MY_GOOS=windows MY_GOARCH=386"
- "MY_GOOS=linux MY_GOARCH=amd64"
- "MY_GOOS=darwin MY_GOARCH=amd64"
- "MY_GOOS=windows MY_GOARCH=amd64"

before_install:
# workaround for travis-ci/gimme#25 to pick up latest version of gimme and run again
- curl -o gimme -sL https://raw.githubusercontent.com/travis-ci/gimme/master/gimme
- chmod u+x gimme
- unset GOROOT GOTOOLDIR
- eval "$(./gimme 1.5)"
- go version
- go env
# workaround for travis-ci/gimme#42
- curl -o go.tar.gz -sL https://storage.googleapis.com/golang/go1.6.3.linux-amd64.tar.gz
- tar -C $HOME -xf go.tar.gz
- rm go.tar.gz
- export GOROOT="${HOME}/go"
- export PATH="${GOROOT}/bin:${PATH}"
- export GOOS="${MY_GOOS}"
- export GOARCH="${MY_GOARCH}"
# end of workaround ###
- go get github.com/axw/gocov/gocov
- go get github.com/mattn/goveralls
Expand All @@ -29,7 +30,7 @@ install:

script:
- "go install -v ./..."
- "if test $GIMME_OS.$GIMME_ARCH = linux.amd64; then ${GOPATH}/bin/gotestcover -v -coverprofile=coverage.report ./...; go tool cover -func=coverage.report; fi"
- "if test $GOOS.$GOARCH = linux.amd64; then ${GOPATH}/bin/gotestcover -v -coverprofile=coverage.report ./...; go tool cover -func=coverage.report; fi"

after_script:
- "$HOME/gopath/bin/goveralls -coverprofile=coverage.report -service=travis-ci"
Expand Down
8 changes: 4 additions & 4 deletions .travis_rename_releases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# set an environment variable for its location that we can use in .travis.yml for
# publishing back to github.

# all cross-compiled binaries are in subdirectories: ${GOPATH}/bin/${GIMME_OS}_${GIMME_ARCH}/
# all cross-compiled binaries are in subdirectories: ${GOPATH}/bin/${GOOS}_${GOARCH}/
# linux 64 bit, not cross-compiled, breaks this rule and is in ${GOPATH}/bin
# therefore move it to match the convention of the others, to simplify subsequent steps
# note: we don't know what we built, so only move it if we happen to be linux amd64 travis job
Expand All @@ -16,10 +16,10 @@ fi

# linux, darwin:
FILE_EXT=""
[ "${GIMME_OS}" == "windows" ] && FILE_EXT=".exe"
[ "${GOOS}" == "windows" ] && FILE_EXT=".exe"

# let's rename the release file because it has a 1:1 mapping with what it is called on
# github releases, and therefore the name for each platform needs to be unique so that
# they don't overwrite each other. Set a variable that can be used in .travis.yml
export RELEASE_FILE="${TRAVIS_BUILD_DIR}/slug-${GIMME_OS}-${GIMME_ARCH}${FILE_EXT}"
mv "${GOPATH}/bin/${GIMME_OS}_${GIMME_ARCH}/slug${FILE_EXT}" "${RELEASE_FILE}"
export RELEASE_FILE="${TRAVIS_BUILD_DIR}/slug-${GOOS}-${GOARCH}${FILE_EXT}"
mv "${GOPATH}/bin/${GOOS}_${GOARCH}/slug${FILE_EXT}" "${RELEASE_FILE}"

0 comments on commit a2f1382

Please sign in to comment.