mirror of
https://github.com/onedr0p/exportarr.git
synced 2026-02-06 10:57:32 +00:00
* 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>
37 lines
722 B
YAML
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 ./...
|