push Go version to 1.17 #7
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: [push, pull_request] | |
name: Go | |
jobs: | |
test: | |
strategy: | |
matrix: | |
go-version: [1.15.x, 1.16.x, 1.17.x] | |
platform: [ubuntu-latest] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: Install libpcap | |
run: sudo apt-get install -y --no-install-recommends libpcap* | |
- name: Install Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Ensure gofmt formatting | |
if: matrix.platform == 'ubuntu-latest' && startsWith(matrix.go-version, '1.17') | |
run: | | |
[ "$(gofmt -l $(find . -name '*.go') 2>&1)" = "" ] | |
- name: Download Go dependencies | |
env: | |
GOPROXY: "https://proxy.golang.org" | |
run: go mod download | |
- name: Test with -race | |
run: go test -race -count=1 ./... | |
- name: golint | |
if: matrix.platform == 'ubuntu-latest' | |
# https://github.com/actions/setup-go/issues/14 | |
run: | | |
export PATH=$PATH:$(go env GOPATH)/bin | |
go get -u golang.org/x/lint/golint | |
golint -set_exit_status $(go list ./... | grep -v internal/unix) | |
- name: staticcheck.io | |
if: matrix.platform == 'ubuntu-latest' | |
# https://github.com/actions/setup-go/issues/14 | |
run: | | |
export PATH=$PATH:$(go env GOPATH)/bin | |
go get -u honnef.co/go/tools/cmd/staticcheck | |
staticcheck -checks all . |