Skip to content

[NH-78392] Add golangci-lint to GHA #98

[NH-78392] Add golangci-lint to GHA

[NH-78392] Add golangci-lint to GHA #98

Workflow file for this run

name: test
on:
pull_request: null
push:
branches:
- master
jobs:
license-check:
runs-on: ubuntu-latest
name: License header check
steps:
- uses: actions/checkout@v3
- run: ./license_check.sh
fmt-check:
runs-on: ubuntu-latest
name: "`gofmt` check"
steps:
- uses: actions/checkout@v3
- uses: Jerome1337/[email protected]
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
version: v1.54
tests:
runs-on: ubuntu-latest
strategy:
matrix:
goversion: ['1.20', '1.21']
name: Go ${{ matrix.goversion }} tests
env:
SW_APM_DEBUG_LEVEL: 1
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.goversion }}
- name: Install dependencies
run: |
go get golang.org/x/tools/cmd/cover
go get github.com/mattn/goveralls
go install github.com/wadey/gocovmerge@latest
go get -t -v ./...
- name: Go vet
run: go vet ./...
- name: Run tests
run: make test
- uses: dominikh/[email protected]
if: matrix.goversion == '1.20'
with:
install-go: false
cache-key: ${{ matrix.goversion }}