diff --git a/.travis.yml b/.travis.yml index 13fb8020d..09a8ddbf2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,30 @@ +dist: trusty sudo: required +# we don't use it, but we also do not want default (ruby) image +language: go + services: - docker -install: false -go: - - 1.8 +# skip default (go get -t -v ./...) install step +install: true script: - - docker build . + - docker build + --build-arg CODECOV_TOKEN=$CODECOV_TOKEN + --build-arg CI=$CI + --build-arg TRAVIS=$TRAVIS + --build-arg TRAVIS_BRANCH=$TRAVIS_BRANCH + --build-arg TRAVIS_COMMIT=$TRAVIS_COMMIT + --build-arg TRAVIS_JOB_ID=$TRAVIS_JOB_ID + --build-arg TRAVIS_JOB_NUMBER=$TRAVIS_JOB_NUMBER + --build-arg TRAVIS_OS_NAME=$TRAVIS_OS_NAME + --build-arg TRAVIS_PULL_REQUEST=$TRAVIS_PULL_REQUEST + --build-arg TRAVIS_PULL_REQUEST_SHA=$TRAVIS_PULL_REQUEST_SHA + --build-arg TRAVIS_REPO_SLUG=$TRAVIS_REPO_SLUG + --build-arg TRAVIS_TAG=$TRAVIS_TAG + . addons: code_climate: diff --git a/Dockerfile b/Dockerfile index 1485c803b..4a7b21d55 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,18 @@ FROM gobuffalo/buffalo:development +ARG CODECOV_TOKEN +ARG CI +ARG TRAVIS +ARG TRAVIS_BRANCH +ARG TRAVIS_COMMIT +ARG TRAVIS_JOB_ID +ARG TRAVIS_JOB_NUMBER +ARG TRAVIS_OS_NAME +ARG TRAVIS_PULL_REQUEST +ARG TRAVIS_PULL_REQUEST_SHA +ARG TRAVIS_REPO_SLUG +ARG TRAVIS_TAG + RUN buffalo version RUN go get -u github.com/alecthomas/gometalinter @@ -30,6 +43,12 @@ RUN go get -v -t ./... RUN go install -v -tags sqlite ./buffalo RUN go test -tags sqlite -race ./... +RUN go test -tags sqlite -coverprofile cover.out -covermode count ./... + +RUN if [ -z "$CODECOV_TOKEN" ] ; then \ + echo codecov not enabled ; \ + else curl -s https://codecov.io/bash -o codecov && \ + bash codecov -f cover.out -X fix; fi RUN gometalinter --vendor --deadline=5m ./...