Skip to content

Commit

Permalink
(API & Delegator) run lint and vet from test action (#1528)
Browse files Browse the repository at this point in the history
* fix: lint & vet from test

* fix: fix linter error
  • Loading branch information
nick-bisonai authored May 29, 2024
1 parent 7676923 commit 29ebbe0
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 33 deletions.
16 changes: 0 additions & 16 deletions .github/workflows/api.image+upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,6 @@ jobs:
cache-dependency-path: |
./api/go.sum
- name: Run lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.54
working-directory: api
skip-pkg-cache: true
skip-build-cache: true
args: --timeout=10m

- name: Run Vet
run: |
cd ./api
go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@latest
go vet
go vet -vettool=$(which shadow)
- name: Docker build orakl-api
run: SERVICE_NAME=orakl-api docker compose -f docker-compose.build.yaml build

Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/api.test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,20 @@ jobs:
check-latest: true
cache-dependency-path: |
./api/go.sum
- name: Run lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.54
working-directory: api
skip-pkg-cache: true
skip-build-cache: true
args: --timeout=10m
- name: Run Vet
run: |
cd ./api
go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@latest
go vet
go vet -vettool=$(which shadow)
- name: Install golang-migrate
run: |
curl -L https://github.com/golang-migrate/migrate/releases/download/v4.17.0/migrate.linux-amd64.tar.gz | tar xvz
Expand Down
16 changes: 0 additions & 16 deletions .github/workflows/delegator.image+upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,22 +58,6 @@ jobs:
cache-dependency-path: |
./delegator/go.sum
- name: Run lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.54
working-directory: delegator
skip-pkg-cache: true
skip-build-cache: true
args: --timeout=10m --skip-dirs=tests

- name: Run vet
run: |
cd ./delegator
go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@latest
go vet
go vet -vettool=$(which shadow)
- name: Docker build orakl-delegator
run: SERVICE_NAME=orakl-delegator docker compose -f docker-compose.build.yaml build

Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/delegator.test+build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,20 @@ jobs:
check-latest: true
cache-dependency-path: |
./delegator/go.sum
- name: Run lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.54
working-directory: delegator
skip-pkg-cache: true
skip-build-cache: true
args: --timeout=10m --skip-dirs=tests
- name: Run vet
run: |
cd ./delegator
go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@latest
go vet
go vet -vettool=$(which shadow)
- name: Install golang-migrate
run: |
curl -L https://github.com/golang-migrate/migrate/releases/download/v4.17.0/migrate.linux-amd64.tar.gz | tar xvz
Expand Down
2 changes: 1 addition & 1 deletion api/blocks/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var validate *validator.Validate

func init() {
validate = validator.New()
validate.RegisterValidation("isZeroOrPositive", func(fl validator.FieldLevel) bool {
_ = validate.RegisterValidation("isZeroOrPositive", func(fl validator.FieldLevel) bool {
return fl.Field().Int() >= 0
})
}
Expand Down

0 comments on commit 29ebbe0

Please sign in to comment.