Skip to content

Commit

Permalink
CI に golangci-lint を採用
Browse files Browse the repository at this point in the history
  • Loading branch information
zztkm committed Sep 23, 2024
1 parent 7de9ac8 commit ceae7b8
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 4 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:

test:
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.23
cache: true
- run: go mod download
- run: go test -shuffle=on -v ./...

golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.23
cache: true
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.61
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ clean:
go clean

.PHONY: lint
lint: $(GOBIN)/staticcheck
staticcheck ./...
lint: $(GOBIN)/golangci-lint
golangci-lint run ./...

$(GOBIN)/staticcheck:
go install honnef.co/go/tools/cmd/staticcheck@latest
$(GOBIN)/golangci-lint:
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest

.PHONY: fmt
fmt:
Expand Down

0 comments on commit ceae7b8

Please sign in to comment.