From 38cae13bbe153412f47223de1e2b79dfe66522bb Mon Sep 17 00:00:00 2001 From: Alexey Palazhchenko Date: Sat, 2 Jun 2018 14:40:12 +0000 Subject: [PATCH 1/2] Minor tweaks for Travis CI configuration. --- .travis.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 13fb8020d..067111d05 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,14 @@ +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 . From 7609b4ba8a232683a18387d21fa5524bac02ced7 Mon Sep 17 00:00:00 2001 From: Alexey Palazhchenko Date: Sat, 2 Jun 2018 14:40:43 +0000 Subject: [PATCH 2/2] Add codecov.io integration. --- .travis.yml | 15 ++++++++++++++- Dockerfile | 19 +++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 067111d05..09a8ddbf2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,20 @@ services: 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 ./...