Skip to content

Commit

Permalink
use gomods; update generated; add CI check for tidy+generate
Browse files Browse the repository at this point in the history
  • Loading branch information
jmank88 committed Aug 6, 2024
1 parent 8ca85b4 commit c8cf87b
Show file tree
Hide file tree
Showing 8 changed files with 93 additions and 81 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/relayer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,21 @@ jobs:
./relayer/coverage.txt
./relayer/race_coverage.txt
check-tidy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Set up Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: "relayer/go.mod"
- name: Ensure "make gomodtidy" has been run
run: |
make gomodtidy
git diff --exit-code
- name: Ensure "make generate" has been run
run: |
make rm-mocked
make generate
git diff --stat --exit-code
23 changes: 18 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,25 @@ format-go-fmt:
cd ./ops && go fmt ./...
cd ./integration-tests && go fmt ./...

.PHONY: gomods
gomods: ## Install gomods
go install github.com/jmank88/[email protected]

.PHONY: gomodtidy
gomodtidy:
cd ./relayer && go mod tidy
cd ./monitoring && go mod tidy
cd ./ops && go mod tidy
cd ./integration-tests && go mod tidy
gomodtidy: gomods
gomods tidy

.PHONY: mockery
mockery: $(mockery) ## Install mockery.
go install github.com/vektra/mockery/[email protected]

.PHONY: rm-mocked
rm-mocked:
grep -rl "^// Code generated by mockery" | grep .go$ | xargs -r rm

.PHONY: generate
generate: mockery gomods
gomods -w go generate -x ./...

.PHONY: format-cairo
format-cairo:
Expand Down
11 changes: 5 additions & 6 deletions monitoring/pkg/monitoring/mocks/Metrics.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion relayer/pkg/chainlink/erc20/mocks/ERC20Reader.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion relayer/pkg/chainlink/ocr2/mocks/OCR2Reader.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 13 additions & 6 deletions relayer/pkg/chainlink/txm/mocks/config.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 0 additions & 56 deletions relayer/pkg/chainlink/txm/mocks/nonce_manager_client.go

This file was deleted.

43 changes: 37 additions & 6 deletions relayer/pkg/starknet/mocks/Reader.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c8cf87b

Please sign in to comment.