Skip to content

Add golangci-lint to CI workflow #6

Add golangci-lint to CI workflow

Add golangci-lint to CI workflow #6

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- main
jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
- name: Restore cached dependencies
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Fetch dependencies
run: go mod download
- name: Run tests
run: go test -count=1 -cover -covermode=atomic .
- name: Run linter
uses: golangci/golangci-lint-action@v3
with:
version: 'latest'