Skip to content

Feat/add GitHub ci

Feat/add GitHub ci #7

Workflow file for this run

name: Linter
on: [pull_request]
jobs:
go-staticcheck:
name: go-staticcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.23.x
- name: Install go-staticcheck
run: |
go get honnef.co/go/tools/cmd/staticcheck@latest # ideally we should version pin
- name: Run go-staticcheck
run: |
PKGS=$(go list ./... | grep -v /vendor/ | grep -v example )
go run honnef.co/go/tools/cmd/staticcheck $PKGS
go-vet:
name: go-vet
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.23.x
- name: Run go-vet
run: |
PKGS=$(go list ./... | grep -v /vendor/ | grep -v example )
go vet -json $PKGS | tee vet-report.json
- name: Upload results
uses: actions/upload-artifact@v3
with:
name: go-vet-results
path: vet-report.json
golangci-lint:
name: golangci-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.23.x
- name: Install golangci-lint
run: |
go get github.com/golangci/golangci-lint/cmd/golangci-lint@latest
- name: Run golangci-lint
run: |
go run github.com/golangci/golangci-lint/cmd/golangci-lint run -v --timeout 10m0s