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; add make generate; add CI check for tidiness+generation #814

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
10 changes: 8 additions & 2 deletions .github/workflows/relay.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,14 @@ jobs:
run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/gotestloghelper@latest
- name: Check go mod tidy
run: |
go mod tidy
echo "if this fails run 'go mod tidy' to fix"
make gomodtidy
echo "if this fails run 'make gomodtidy' to fix"
git diff --minimal --exit-code
- name: Check go generate
run: |
make rm-mocked
make generate
echo "if this fails run 'make generate' to fix"
git diff --stat --exit-code
- name: Install Solana CLI
run: ./scripts/install-solana-ci.sh
Expand Down
22 changes: 19 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,25 @@ test_smoke:
cd ./integration-tests &&\
SELECTED_NETWORKS=SIMULATED go test -timeout 24h -count=1 -json $(args) -run TestSolanaOCRV2Smoke ./smoke 2>&1 | tee /tmp/gotest.log | gotestloghelper -json -tlogprefix -singlepackage -color

gomodtidy:
go mod tidy
cd ./integration-tests && go mod tidy
.PHONY: gomods
gomods: ## Install gomods
go install github.com/jmank88/[email protected]

.PHONY: gomodtidy
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: lint-go-integration-tests
lint-go-integration-tests:
Expand Down
15 changes: 9 additions & 6 deletions pkg/monitoring/metrics/mocks/FeedBalances.go

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

11 changes: 5 additions & 6 deletions pkg/monitoring/metrics/mocks/Fees.go

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

35 changes: 0 additions & 35 deletions pkg/monitoring/metrics/mocks/Metrics.go

This file was deleted.

11 changes: 5 additions & 6 deletions pkg/monitoring/metrics/mocks/NetworkFees.go

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

11 changes: 5 additions & 6 deletions pkg/monitoring/metrics/mocks/NodeBalances.go

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

11 changes: 5 additions & 6 deletions pkg/monitoring/metrics/mocks/NodeSuccess.go

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

11 changes: 5 additions & 6 deletions pkg/monitoring/metrics/mocks/ReportObservations.go

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

11 changes: 5 additions & 6 deletions pkg/monitoring/metrics/mocks/SlotHeight.go

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

43 changes: 37 additions & 6 deletions pkg/monitoring/mocks/ChainReader.go

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

Loading
Loading