Skip to content

Commit

Permalink
CI: switch to GitHub Action (#142)
Browse files Browse the repository at this point in the history
* Create go.yml

* ignore windows crlf problem

* remove travis

* coverage CI

* fix coverage

* rename jobs

* coverage

* fix name

* maybe don't need get dependencies?

* goveralls

* manual setup goveralls

* linter

* get tools

* fix path
  • Loading branch information
dannypsnl authored Apr 30, 2020
1 parent 6a9fa5e commit 116ce41
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 26 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Go

on:
- push
- pull_request

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Run linters
run: |
GO111MODULE=off go get golang.org/x/lint/golint
GO111MODULE=off go get github.com/mgechev/revive
echo "### revive"
$(go env GOPATH)/bin/revive -config .revive.toml ./...
echo "### golint"
$(go env GOPATH)/bin/golint ./...
exit 0
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
go-version: [1.12, 1.13, 1.14]
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Get dependencies
run: |
go get -t ./...
- name: Go Test
run: go test ./...
- name: Go Race Test
run: go test -race ./...
coverage:
name: Coverage
runs-on: ubuntu-latest
steps:
- name: Install Go
if: success()
uses: actions/setup-go@v1
with:
go-version: 1.13
- name: Checkout code
uses: actions/checkout@v2
- name: Calculate coverage
run: |
go test -v -covermode=count -coverprofile=coverage.out ./...
- name: Coveralls
env:
COVERALLS_TOKEN: "YZKB1SLTzPJMOdXp5U3xwEsh4++Xe8EeVK8SZVEQkn/y4xCbzmbdo6BJ4B/eGBG6bK4DLzFD3sb6uaUB2bHlVUXnR8YHbetjps6PUwLYtX9UdcBjB7UN5tdQs1d8k2qg7vPNtKVEY4kJHFURijc4Kk+zlNbq1oGJcEfm6gz+zGg="
run: |
GO111MODULE=off go get github.com/mattn/goveralls
$(go env GOPATH)/bin/goveralls -coverprofile=coverage.out -service=github
26 changes: 0 additions & 26 deletions .travis.yml

This file was deleted.

0 comments on commit 116ce41

Please sign in to comment.