Skip to content

CI: use staticcheck-action #13

CI: use staticcheck-action

CI: use staticcheck-action #13

Workflow file for this run

on: [push, pull_request]
name: Go
jobs:
test:
strategy:
matrix:
go-version: [1.17.x, 1.20.x, 1.21.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.21')
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: staticcheck.io
if: startsWith(matrix.go-version, '1.21')
uses: dominikh/staticcheck-action@v1.3.0
with:
version: "2023.1.6"
install-go: false
cache-key: ${{ matrix.go }}