Skip to content

Commit

Permalink
setup tools
Browse files Browse the repository at this point in the history
  • Loading branch information
seiyab committed Apr 26, 2024
1 parent db05a0a commit 57617aa
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
42 changes: 42 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Go

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

jobs:
build-and-test:
strategy:
matrix:
go-version: ["1.18", "1.19", "1.20", "1.21", "1.22"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}

- name: Build
run: go build -v ./...

- name: Test
run: go test -v ./...
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.22"

- name: Set up Staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@latest

- name: Run Staticcheck
run: staticcheck ./...
18 changes: 18 additions & 0 deletions .github/workflows/review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: reviewdog
on: [pull_request]
jobs:
reviewdog:
name: reviewdog
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: "1.21" # gost requires go 1.21 or later
- name: Install gost
run: go install github.com/seiyab/gost@latest
- uses: reviewdog/action-setup@v1
- name: Run reviewdog
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: reviewdog -reporter=github-pr-review -runners=gost
5 changes: 5 additions & 0 deletions .reviewdog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
runner:
gost:
cmd: go vet -vettool="$(which gost)" ./...
format: govet
level: warning

0 comments on commit 57617aa

Please sign in to comment.