From 3a999480e910c4296c4cbdb6bc431eb3efca7a02 Mon Sep 17 00:00:00 2001 From: Dong-hee Na Date: Fri, 6 Dec 2019 15:36:49 +0900 Subject: [PATCH] gh-37: Add workflow file for Github Action (#38) * Setting up Github Action * remove Travis CI * Update README.md --- .github/workflows/ci.yml | 36 ++++++++++++++++++++++++++++++++++++ .travis.yml | 19 ------------------- README.md | 2 -- 3 files changed, 36 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..122bc69 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,36 @@ +on: [pull_request] +name: goimagehash workflow +jobs: + test: + strategy: + matrix: + go-version: [1.6.x, 1.7.x, 1.8.x, 1.9.x, 1.10.x, 1.11.x, 1.12.x, 1.13.x] + platform: [ubuntu-latest] + runs-on: ${{ matrix.platform }} + steps: + - name: Install Go + uses: actions/setup-go@v1 + with: + go-version: ${{ matrix.go-version }} + - name: Set GOPATH + run: | + echo "##[set-env name=GOPATH;]$(dirname $GITHUB_WORKSPACE)" + id: gopath + + - name: Checkout code + uses: actions/checkout@v1 + with: + path: src/github.com/corona10/goimagehash + + - name: Install + run: go get -t -v ./... + + - name: Test and coverage + run: go test -coverprofile=coverage.txt -covermode=atomic + + - name: Upload codecoverage to CodeCov + uses: codecov/codecov-action@v1.0.4 + with: + token: ${{secrets.CODECOV_TOKEN}} + file: ./coverage.txt + flags: unittests diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7ee783c..0000000 --- a/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: go - -go: - - 1.6.x - - 1.7.x - - 1.8.x - - 1.9.x - - 1.10.x - - 1.11.x - - 1.12.x - - 1.13.x - -before_install: - - go get github.com/axw/gocov/gocov - - go get github.com/mattn/goveralls - - if ! go get github.com/golang/tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi - -script: - - $HOME/gopath/bin/goveralls -service=travis-ci diff --git a/README.md b/README.md index 6055202..c214fe7 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ -[![Build Status](https://travis-ci.org/corona10/goimagehash.svg?branch=master)](https://travis-ci.org/corona10/goimagehash) [![GoDoc](https://godoc.org/github.com/corona10/goimagehash?status.svg)](https://godoc.org/github.com/corona10/goimagehash) [![Go Report Card](https://goreportcard.com/badge/github.com/corona10/goimagehash)](https://goreportcard.com/report/github.com/corona10/goimagehash) -[![Coverage Status](https://coveralls.io/repos/github/corona10/goimagehash/badge.svg)](https://coveralls.io/github/corona10/goimagehash) # goimagehash > Inspired by [imagehash](https://github.com/JohannesBuchner/imagehash)