ashmrtn 395c7c8525
Add spell check linter and run gofmt in golangci-lint (#396)
* Basic golangci-lint config with gofmt and timeout

Remove corresponding sections from other CI config files.

* Enable comment and string spelling linter

* Fix spelling mistakes for linter

Co-authored-by: Danny <danny@alcion.ai>
2022-07-22 18:28:25 +00:00

52 lines
1.2 KiB
YAML

name: Linting of Source Code
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
Linting:
environment: Testing
runs-on: ubuntu-latest
defaults:
run:
working-directory: src
steps:
- name: Checkout src code
uses: actions/checkout@v3
- name: Golang Setup
uses: actions/setup-go@v3
with:
go-version: 1.18
- name: Cache Go Mod
uses: actions/cache@v3
id: cache
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
- name: Download package dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: go mod download
- name: Cache Go build
uses: actions/cache@v3
id: mybuild
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
- name: Build for Lint
if: steps.mybuild.outputs.cache-hit != 'true'
run: go build ./...
- name: Go Lint
uses: golangci/golangci-lint-action@v3.2.0
with:
version: v1.45.2
working-directory: ./src
skip-pkg-cache: true