Skip to content

Commit

Permalink
Merge pull request #7 from netboxlabs/OBS-8-gha-golangci-lint
Browse files Browse the repository at this point in the history
feat: OBS-8 - golangci-lint GitHub action workflow
  • Loading branch information
mfiedorowicz authored Jan 29, 2024
2 parents 7e0be50 + c1d239c commit a6d8d64
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
run:
timeout: 5m
modules-download-mode: readonly

output:
format: github-actions

linters:
enable:
- revive
- errcheck
- unused
- staticcheck
- ineffassign
- govet
- gosimple
- bodyclose

issues:
exclude-use-default: false
exclude-rules:
- path: /*.go
text: "package-comments: should have a package comment"
linters:
- revive

severity:
default-severity: error
33 changes: 33 additions & 0 deletions .github/workflows/golangci-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: golangci-lint
on:
push:
branches:
- "!release"
pull_request:

permissions:
contents: read

jobs:
golangci:
strategy:
matrix:
go: [
"diode-sdk-go",
"diode-server",
]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.21'
cache: false
- name: golangci-lint ${{ matrix.go }}
uses: golangci/golangci-lint-action@v3
with:
version: v1.54
working-directory: ${{ matrix.go }}
args: --config ../.github/golangci.yaml
skip-pkg-cache: true
skip-build-cache: true

0 comments on commit a6d8d64

Please sign in to comment.