Skip to content

Commit

Permalink
Setup CI in GitHub Action
Browse files Browse the repository at this point in the history
  • Loading branch information
iawia002 committed May 9, 2024
1 parent cfa5ca9 commit b10f029
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI
on:
push:
branches:
- 'main'
- 'release-**'
pull_request:
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.22"
- name: Lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
codegen:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Protoc
uses: arduino/setup-protoc@v3
- name: Verify codegen
run: |
make gen
if [ -n "$(git status --porcelain)" ]; then
echo "codegen is out of date. Please run `make gen` to update."
exit 1
else
echo "codegen is up to date."
fi
23 changes: 23 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
run:
timeout: 5m
go: 1.22

linters:
enable:
- revive
- goconst
- gofmt
- goimports
- misspell
- unparam
disable:
- deadcode

issues:
exclude-use-default: false
exclude-rules:
- path: _test.go
linters:
- errcheck
exclude:
- (comment on exported (method|function|type|const)|should have( a package)? comment|comment should be of the form)

0 comments on commit b10f029

Please sign in to comment.