-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ Add makefile and update ci config
- Loading branch information
Showing
7 changed files
with
114 additions
and
35 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# This workflow will build a golang project | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | ||
|
||
name: 'PR CI' | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
check: | ||
runs-on: self-hosted | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: setup-go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.21' | ||
- name: build | ||
run: go build -v ./... | ||
- name: golangci-lint | ||
run: make lint | ||
- name: format | ||
run: | | ||
make format | ||
if [ -z "$(git status --untracked-files=no --porcelain)" ]; then | ||
echo "All files formatted" | ||
else | ||
echo "Running format is required" | ||
exit 1 | ||
fi | ||
- name: test | ||
run: make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
run: | ||
timeout: 5m | ||
go: "1.19" | ||
skip-files: | ||
- "bindata.go" | ||
|
||
linters: | ||
disable-all: true | ||
fast: false | ||
enable: | ||
- errcheck | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- goimports | ||
- staticcheck | ||
- typecheck | ||
- unused | ||
- whitespace | ||
- errname | ||
- godot | ||
- exportloopref | ||
- goconst | ||
- gocritic | ||
- gosec | ||
- misspell | ||
- nakedret | ||
- nolintlint | ||
- stylecheck | ||
- unconvert | ||
- usestdlibvars | ||
- revive | ||
- reassign | ||
- predeclared | ||
- errorlint | ||
# - testpackage // Consider to adopt in the future | ||
|
||
issues: | ||
exclude-rules: | ||
- source: "(noinspection|TODO)" | ||
linters: [ godot ] | ||
- path: "_test\\.go" | ||
linters: | ||
- goconst | ||
- gosec | ||
- errcheck | ||
- text: "Use of weak random number generator" | ||
linters: | ||
- gosec | ||
max-same-issues: 50 | ||
|
||
linters-settings: | ||
revive: | ||
enable-all-rules: false | ||
rules: | ||
- name: var-naming | ||
disabled: true | ||
stylecheck: | ||
checks: ["*", "-ST1003"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# makefile | ||
|
||
PKGS=$(shell go list ./... | grep -v "/vendor/") | ||
|
||
.PHONY: test | ||
|
||
test: | ||
@echo "Test packages" | ||
@go test -race -shuffle=on -coverprofile=coverage.out -cover $(PKGS) | ||
|
||
lint: | ||
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest | ||
golangci-lint run | ||
format: | ||
gofmt -s -w . | ||
godocs: | ||
@go install golang.org/x/tools/cmd/godoc@latest | ||
@echo "open http://localhost:6060/pkg/github.com/LiskHQ/lisk-engine" | ||
godoc -http=:6060 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ import ( | |
|
||
func main() { | ||
logger, err := log.NewDefaultProductionLogger() | ||
|
||
if err != nil { | ||
panic(err) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
// Package faultdetector implements Optimisim fault detector | ||
// Package faultdetector implements Optimism fault detector | ||
package faultdetector |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters