Add go.yml github workflow (#2902)
This commit is contained in:
committed by
kannappanr
parent
57a9c6fab2
commit
1db7a3bbed
@@ -0,0 +1,43 @@
|
||||
name: Go
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Test on Go ${{ matrix.go-version }} and ${{ matrix.os }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.13.x]
|
||||
os: [ubuntu-latest, windows-latest]
|
||||
steps:
|
||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v1
|
||||
|
||||
- name: Build on ${{ matrix.os }}
|
||||
if: matrix.os == 'windows-latest'
|
||||
env:
|
||||
GO111MODULE: on
|
||||
run: go test -v -race ./...
|
||||
- name: Build on ${{ matrix.os }}
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
env:
|
||||
GO111MODULE: on
|
||||
run: |
|
||||
diff -au <(gofmt -d *.go) <(printf "")
|
||||
diff -au <(gofmt -d cmd) <(printf "")
|
||||
diff -au <(gofmt -d pkg) <(printf "")
|
||||
go test -v -race ./...
|
||||
make test
|
||||
Reference in New Issue
Block a user