Skip to content

Commit

Permalink
Add a GitHub action for running go build and testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
robshakir committed Apr 28, 2020
1 parent f3d50fd commit 9716895
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/go.yml
@@ -0,0 +1,61 @@
name: Go

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
go: ['1.12', '1.13', '1.14']
steps:

- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Get dependencies
run: |
go get -v -t -d ./...
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
fi
- name: Build
run: go build -v ./...

- name: Test
run: go test -v -coverprofile=profile.cov ./...

- name: Race Test
run: go test -race ./...

- name: Send Coverage
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: profile.cov
parallel: true

- name: Check gofmt
run: diff -u <(echo -n) <(gofmt -d -s .)

finish:
needs: build
runs-on: ubuntu-latest
steps:
- uses: shogo82148/actions-goveralls@v1
with:
parallel-finished: true


0 comments on commit 9716895

Please sign in to comment.