exportarr/.github/actions/tests/action.yaml
Russell Troxel b8426af721
Add golangci-lint, fix lint warnings (#227)
* Add golangci-lint, fix lint warnings

Signed-off-by: Russell Troxel <russell@troxel.io>

* Set `shell` on lint actions

Signed-off-by: Russell Troxel <russell@troxel.io>

* go fmt

Signed-off-by: Russell Troxel <russell@troxel.io>

---------

Signed-off-by: Russell Troxel <russell@troxel.io>
2023-10-08 14:15:07 -04:00

37 lines
722 B
YAML

---
name: Tests
description: Runs Go tests
runs:
using: composite
steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ">=1.19"
- name: Check Go Fmt
shell: bash
run: |
go version
go fmt ./...
git diff --exit-code
- name: Check Go Mod
shell: bash
run: |
go version
go mod tidy
git diff --exit-code
- uses: golangci/golangci-lint-action@v2
with:
version: v1.51.2
args: --timeout 5m --config .github/lint/golangci.yaml
- name: Run Unit tests
shell: bash
run: |
go version
go test -v -race -covermode atomic -coverprofile=covprofile ./...