Skip to content

Commit

Permalink
better build workflow on PR
Browse files Browse the repository at this point in the history
  • Loading branch information
akhiljns committed Apr 1, 2024
1 parent 9baab15 commit 895a03e
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/.golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
run:
concurrency: 2
timeout: 5m

linters-settings:
staticcheck:
checks: ["all", "-SA1029"]
misspell:
locale: US


linters:
disable-all: true
enable:
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- typecheck
- unused
- gosec
- gocritic
- misspell
39 changes: 39 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: build

on:
pull_request:

jobs:
codereview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: reviewdog/action-golangci-lint@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
go_version: "1.19"
golangci_lint_flags: "--config=.github/.golangci.yml"
reporter: github-pr-review

format:
needs: codereview
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Format and test
run: |
go fmt ./...
go vet ./...
# go test -race ./... -v
compile:
needs: format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: |
mkdir -p mybinaries
go build -o mybinaries ./...

0 comments on commit 895a03e

Please sign in to comment.