Skip to content

Add github workflow

Add github workflow #3

name: Go generate & lint
on:
push:
branches: [master, main]
pull_request:
branches: [master, main]
jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.25.1"
- name: Run generate
run: make generate
- name: Fail if generate produced a diff
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "::error::make generate produced uncommitted changes. Run 'make generate' and commit the result."
git status --porcelain
git diff
exit 1
fi
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.25.1"
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.61.0
args: --timeout=5m