Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use gomods; update generated; add CI check for tidy+generate #505

Merged
merged 1 commit into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/relayer.yml
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should either make check-tidy required, or move it up in to an existing required step.

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/gomods@v0.1.3

.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/v2@v2.43.2

.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.

Loading