Skip to content

Commit

Permalink
Merge pull request #14 from grafana/inkel/gh-workflow/go
Browse files Browse the repository at this point in the history
Add Go GitHub action
  • Loading branch information
inkel authored May 29, 2024
2 parents 6ac01f5 + 5a425c6 commit 183cf08
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Go

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

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.21

- name: Test
run: make test

- name: Benchmark
run: make benchmark

checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.21

- name: Checks
run: make checks
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
PKG ?= ./...

checks:
go vet $(PKG)
go run honnef.co/go/tools/cmd/staticcheck@latest $(PKG)
go run github.com/golangci/golangci-lint/cmd/golangci-lint@latest run $(PKG)

test:
go test $(PKG)

benchmark:
go test -run='^$$' -bench=. -benchmem

0 comments on commit 183cf08

Please sign in to comment.