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

codecov.io code coverage integration #1087

Merged
merged 8 commits into from
Jun 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 ./...

Expand Down