diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..acab322 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,50 @@ +version: 2 +jobs: + build: + docker: + - image: circleci/golang:1.16 + + working_directory: /go/src/github.com/mrobinsn/go-newznab + + environment: + TEST_RESULTS: /tmp/test-results + + steps: + - checkout + - run: + name: Install App + command: | + go install ./... + - run: + name: Lint + command: | + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.41.1 + golangci-lint run -v + - run: + name: Install Test Dependencies + command: | + (cd; GO111MODULE=on go get github.com/jstemmer/go-junit-report) + (cd; GO111MODULE=on go get github.com/go-playground/overalls) + - run: + name: Run unit tests + command: | + mkdir -p $TEST_RESULTS + trap "go-junit-report < \"${TEST_RESULTS}/go-test.out\" > \"${TEST_RESULTS}/go-test-report.xml\"" EXIT + go test -v -race ./... 2>&1 | tee "${TEST_RESULTS}/go-test.out" + - run: + name: Calculate Coverage + command: | + overalls -project /go/src/github.com/mrobinsn/go-newznab + mv overalls.coverprofile coverage.txt + bash <(curl -s https://codecov.io/bash) + - store_artifacts: + path: /tmp/test-results + destination: raw-test-output + - store_test_results: + path: /tmp/test-results + +workflows: + version: 2 + build_and_test: + jobs: + - build diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a6c4d8d..0000000 --- a/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: go -go: - - stable -before_install: - - go get -u github.com/mattn/goveralls -script: - - go vet ./... - - goveralls -race -v -show -service=travis-ci diff --git a/README.md b/README.md index b700484..d79b184 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,8 @@ [![GoDoc](https://godoc.org/github.com/mrobinsn/go-newznab/newznab?status.svg)](https://godoc.org/github.com/mrobinsn/go-newznab/newznab) [![Go Report Card](https://goreportcard.com/badge/github.com/mrobinsn/go-newznab)](https://goreportcard.com/report/github.com/mrobinsn/go-newznab) [![Build Status](https://travis-ci.org/mrobinsn/go-newznab.svg?branch=master)](https://travis-ci.org/mrobinsn/go-newznab) -[![Coverage Status](https://coveralls.io/repos/github/mrobinsn/go-newznab/badge.svg?branch=master)](https://coveralls.io/github/mrobinsn/go-newznab?branch=master) +[![CircleCI](https://circleci.com/gh/mrobinsn/go-newznab.svg?style=svg)](https://circleci.com/gh/mrobinsn/go-newznab) +[![codecov](https://codecov.io/gh/mrobinsn/go-newznab/branch/master/graph/badge.svg?token=MB1QbbEiAT)](https://codecov.io/gh/mrobinsn/go-newznab) [![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT) diff --git a/newznab/newznab_test.go b/newznab/newznab_test.go index ce8633a..8435590 100644 --- a/newznab/newznab_test.go +++ b/newznab/newznab_test.go @@ -36,9 +36,9 @@ func TestUsenetCrawlerClient(t *testing.T) { if err != nil { w.WriteHeader(http.StatusNotFound) - w.Write([]byte("File not found")) + w.Write([]byte("File not found")) // nolint:errcheck } else { - w.Write(f) + w.Write(f) // nolint:errcheck } }))