Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: CI

on:
push:
branches:
- main
Comment thread
silv-io marked this conversation as resolved.
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version-file: .tool-versions
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
golangci-lint 2.8.0
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BINARY_NAME=lstk
BUILD_DIR=bin

.PHONY: build clean test test-integration mock-generate
.PHONY: build clean test test-integration lint mock-generate

build:
go build -o $(BUILD_DIR)/$(BINARY_NAME) .
Expand All @@ -17,3 +17,9 @@ test-integration: build

mock-generate:
go generate ./...

lint:
@EXPECTED=$$(awk '/^golangci-lint/ {print $$2}' .tool-versions); \
INSTALLED=$$(golangci-lint version --short 2>/dev/null | sed 's/^v//'); \
[ "$$INSTALLED" = "$$EXPECTED" ] || { echo "golangci-lint $$EXPECTED required (found: $$INSTALLED)"; exit 1; }
golangci-lint run