Skip to content

Commit

Permalink
Add lint job
Browse files Browse the repository at this point in the history
  • Loading branch information
samherrmann committed Jan 16, 2024
1 parent 521ba81 commit 98b820e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

name: Go

on:
Expand All @@ -8,7 +8,7 @@ on:
tags:
- 'v*.*.*'
pull_request:
branches:
branches:
- main

jobs:
Expand All @@ -29,6 +29,11 @@ jobs:
- name: Get dependencies
run: go get -v -t -d ./...

- name: Lint
uses: dominikh/staticcheck-action@v1.2.0
with:
version: 2023.1.6

- name: Test
run: make test

Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,21 @@ zip = (cd dist && zip -r $$GOOS-$$GOARCH.zip $$GOOS-$$GOARCH/*)
build:
mkdir -p dist && go build -o dist ./serveit

build.all:
build.all:
export GOOS=linux; export GOARCH=386; $(gobuild) && $(tar)
export GOOS=linux; export GOARCH=amd64; $(gobuild) && $(tar)
export GOOS=windows; export GOARCH=amd64; $(gobuild) && $(zip)
export GOOS=windows; export GOARCH=386; $(gobuild) && $(zip)

lint:
staticcheck -checks=all ./...

test:
CGO_ENABLED=1 go test ./... -race -cover

clean:
rm -rf dist

# Resources:
# List of available target OSs and architectures:
# List of available target OSs and architectures:
# https://golang.org/doc/install/source#environment

0 comments on commit 98b820e

Please sign in to comment.