Skip to content

Commit

Permalink
workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jmnote committed Dec 29, 2023
1 parent 1e0953d commit 186016b
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ jobs:
steps:
- uses: actions/setup-go@v4
- uses: actions/checkout@v3
with:
go-version: '^1.21.5'
- run: go vet ./...

staticcheck:
Expand Down Expand Up @@ -73,7 +75,6 @@ jobs:
- uses: actions/setup-go@v4
- uses: actions/checkout@v3
- run: go test ./... -race -covermode=atomic -coverprofile=coverprofile
- run: cat coverprofile | grep -v yaccpar > coverage.out
- uses: codecov/codecov-action@v3
- run: go install github.com/mattn/goveralls@latest
- run: goveralls -coverprofile=coverage.out -service=github
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@
go.work

# custom
bin/
tmp/
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,11 @@ init:

run:
air

checks: misspell gocyclo

misspell:
sh hack/misspell.sh

gocyclo:
sh hack/gocyclo.sh
11 changes: 11 additions & 0 deletions hack/gocyclo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
cd $(dirname $0)/../

which gocyclo || go install github.com/fzipp/gocyclo/cmd/gocyclo@latest

gocyclo -over 15 -ignore letheql/parser .
if [[ $? != 0 ]]; then
echo "❌ FAIL"
exit 1
fi
echo "✔️ OK"
11 changes: 11 additions & 0 deletions hack/misspell.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
cd $(dirname $0)/..

[ -f ./bin/misspell ] || curl -L https://git.io/misspell | bash

find . -type f -name '*.*' | xargs ./bin/misspell -error
if [[ $? != 0 ]]; then
echo "❌ FAIL - misspell found"
exit 1
fi
echo "✔️ OK - misspell not found"

0 comments on commit 186016b

Please sign in to comment.