Skip to content

Go

Go #735

Workflow file for this run

name: Go
on:
push:
branches: [ master ]
pull_request:
schedule:
- cron: "0 0 * * *"
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
go: ['1.12', '1.13', '1.14', '1.15', '1.16', '1.x']
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 ./...
- name: Build
run: go build -v ./...
- name: Test
run: go test -v -coverprofile=profile.cov ./...
- name: Race Test
run: go test -race ./...
- name: Coveralls
if: ${{ matrix.go == '1.14' }}
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: profile.cov
static_analysis:
name: Static Analysis
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: '1.x'
id: go
- name: Install required static analysis tools
run: |
go install honnef.co/go/tools/cmd/staticcheck@latest
- name: Check out ygot code
uses: actions/checkout@v2
- name: Go vet
run: go vet ./...
- name: Check gofmt
run: diff -u <(echo -n) <(gofmt -d -s .)
- name: Staticcheck
run: |
staticcheck ./...