From f3cedb24acc668f8cac2fec8874ecc8da1cd506e Mon Sep 17 00:00:00 2001 From: Anton Krivenko Date: Sat, 23 Jan 2021 04:21:20 +0300 Subject: [PATCH] Travis -> GitHub Actions --- .github/workflows/workflow.yml | 52 ++++++++++++++++++++++++++++++++++ .travis.yml | 28 ------------------ README.md | 4 +-- 3 files changed, 54 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/workflow.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml new file mode 100644 index 0000000..4056c9d --- /dev/null +++ b/.github/workflows/workflow.yml @@ -0,0 +1,52 @@ +on: + push: + branches: + - master + pull_request: + +name: Test +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v2 + + - name: Run linter + uses: golangci/golangci-lint-action@v2 + with: + version: v1.35.2 + + test: + name: Test + strategy: + matrix: + go-version: [1.14.x, 1.15.x] + os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} + steps: + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Restore cache + uses: actions/cache@v2 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-v1-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-v1-go- + + - name: Run tests + run: go test -race -covermode=atomic -coverprofile=coverage.out ./... + + - name: Upload coverage report to Coveralls + if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.15.x' + uses: shogo82148/actions-goveralls@v1 + with: + path-to-profile: coverage.out diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d55a454..0000000 --- a/.travis.yml +++ /dev/null @@ -1,28 +0,0 @@ -language: go -go: - - 1.15.6 - - tip -matrix: - allow_failures: - - go: tip - -notifications: - email: - recipients: dean.karn@gmail.com - on_success: change - on_failure: always - -before_install: - - go get -u github.com/mattn/goveralls - -before_script: - - go mod download - -script: - - make lint - - make test - -after_success: | - [ $TRAVIS_GO_VERSION = 1.15.6 ] && - go test ./... -covermode=count -coverprofile=coverage.out && - goveralls -coverprofile=coverage.out -service travis-ci -repotoken $COVERALLS_TOKEN diff --git a/README.md b/README.md index 7d4ccd3..530f691 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ Library webhooks ================ ![Project status](https://img.shields.io/badge/version-6.0.0-green.svg) -[![Build Status](https://travis-ci.org/go-playground/webhooks.svg?branch=v6)](https://travis-ci.org/go-playground/webhooks) -[![Coverage Status](https://coveralls.io/repos/go-playground/webhooks/badge.svg?branch=v6&service=github)](https://coveralls.io/github/go-playground/webhooks?branch=v6) +![Test](https://github.com/go-playground/webhooks/workflows/Test/badge.svg?branch=master) +[![Coverage Status](https://coveralls.io/repos/go-playground/webhooks/badge.svg?branch=master&service=github)](https://coveralls.io/github/go-playground/webhooks?branch=master) [![Go Report Card](https://goreportcard.com/badge/go-playground/webhooks)](https://goreportcard.com/report/go-playground/webhooks) [![GoDoc](https://godoc.org/github.com/go-playground/webhooks/v6?status.svg)](https://godoc.org/github.com/go-playground/webhooks/v6) ![License](https://img.shields.io/dub/l/vibe-d.svg)