Skip to content

Commit

Permalink
ci: add test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
askalt committed Jul 27, 2023
1 parent 2bde0bc commit 02e3f3e
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Tests

on: [push, pull_request, workflow_dispatch]

jobs:
tests:
if: (github.event_name == 'push') ||
(github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name != github.repository) ||
(github.event_name == 'workflow_dispatch')

runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@master

- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.19'

- name: Go linter
uses: golangci/golangci-lint-action@v3
with:
args: --config=golangci-lint.yml --out-${NO_FUTURE}format colored-line-number
skip-cache: true

- name: Unit tests
run: |
go test -race ./...
30 changes: 30 additions & 0 deletions golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
run:
timeout: 3m

linters:
disable-all: true
enable:
- lll
- govet
- gofmt
- stylecheck
- godot

linters-settings:
lll:
line-length: 100
tab-width: 4
gofmt:
simplify: false
stylecheck:
# Temporary disable "Poorly chosen identifier" check.
checks: ["all", "-ST1003"]
godot:
scope: toplevel
period: true

issues:
exclude-rules:
- linters:
- lll
source: "\t?// (see )?https://"

0 comments on commit 02e3f3e

Please sign in to comment.