Skip to content

Commit

Permalink
Add GitHub actions (#16)
Browse files Browse the repository at this point in the history
* travis no more
  • Loading branch information
phanirithvij authored Sep 23, 2021
1 parent 5ab39f6 commit 525f6e1
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 17 deletions.
81 changes: 81 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
on:
push:
branches:
- master
pull_request:
branches:
- master

name: run tests
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: x${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.16.x
- name: Checkout code
uses: actions/checkout@v2
- name: Run linters
uses: golangci/golangci-lint-action@v2
with:
version: v1.29

test:
needs: lint
strategy:
matrix:
go-version: [1.16.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: x${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install Go
if: success()
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Run tests
run: go test -v -covermode=count

coverage:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: x${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install Go
if: success()
uses: actions/setup-go@v2
with:
go-version: 1.16.x
- name: Checkout code
uses: actions/checkout@v2
- name: Calc coverage
run: |
go test -v -covermode=count -coverprofile=coverage.out
- name: Convert coverage.out to coverage.lcov
uses: jandelgado/[email protected]
- name: Coveralls
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.github_token }}
path-to-lcov: coverage.lcov
17 changes: 0 additions & 17 deletions .travis.yml

This file was deleted.

0 comments on commit 525f6e1

Please sign in to comment.