Skip to content

Commit

Permalink
add ci for running Go unit tests and linter
Browse files Browse the repository at this point in the history
  • Loading branch information
mangalaman93 committed Oct 3, 2024
1 parent 6fa4e7c commit c61f94d
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/ci-go-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: ci-go-tests

on:
pull_request:
paths-ignore:
- '**/**.gitignore'
- '**/**.md'
types:
- opened
- reopened
- synchronize
- ready_for_review
branches:
- main

jobs:
ci-go-tests:
if: github.event.pull_request.draft == false
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache-dependency-path: go.sum

- name: golangci-lint
uses: golangci/[email protected]

- name: Run Unit Tests
run: go test -race -v ./...
22 changes: 22 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
linters-settings:
lll:
line-length: 120

linters:
disable-all: true
enable:
- errcheck
- gosec
- gofmt
- goimports
- gosimple
- govet
- ineffassign
- lll
- staticcheck
- unconvert
- unused
- typecheck
- prealloc
- nakedret
- gochecknoinits

0 comments on commit c61f94d

Please sign in to comment.