## Summary: It would be nice to have some linting beyond `go vet`! Now we do. I started by copying the config from Khan/webapp. I did remove a couple of staticcheck checks that I didn't feel were useful. (Note also that exportloopref is the replacement for scopelint in newer golangci-lint.) Included are all the needed lint fixes; most are stylistic but the changes in the example are a (minor) bugfix. Fixes #22. Issue: https://github.com/Khan/genqlient/issues/22 ## Test plan: make check Author: benjaminjkraft Reviewers: aberkan, dnerdy, benjaminjkraft, csilvers, MiguelCastillo Required Reviewers: Approved by: aberkan, dnerdy Checks: ✅ Test (1.17), ✅ Test (1.16), ✅ Test (1.15), ✅ Test (1.14), ✅ Test (1.13), ✅ Lint, ✅ Test (1.17), ✅ Test (1.16), ✅ Test (1.15), ✅ Test (1.14), ✅ Test (1.13), ✅ Lint Pull request URL: https://github.com/Khan/genqlient/pull/49
46 lines
831 B
YAML
46 lines
831 B
YAML
name: Go
|
|
|
|
on:
|
|
push:
|
|
branches: [ "*" ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
build:
|
|
name: Test
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
go: [ '1.13', '1.14', '1.15', '1.16', '1.17' ]
|
|
|
|
steps:
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v1
|
|
with:
|
|
go-version: ${{ matrix.go }}
|
|
id: go
|
|
|
|
- name: Git checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Run tests
|
|
env:
|
|
# Needed for the example-test to run.
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
go test -cover -v ./...
|
|
|
|
lint:
|
|
name: Lint
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Git checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Run lint
|
|
uses: golangci/golangci-lint-action@v2
|
|
with:
|
|
version: v1.42 # should match go.mod
|