Skip to content

Commit

Permalink
use gomods; add make generate; add CI check for tidiness+generation
Browse files Browse the repository at this point in the history
  • Loading branch information
jmank88 committed Aug 6, 2024
1 parent 02a42e0 commit 0e5fe88
Show file tree
Hide file tree
Showing 15 changed files with 243 additions and 112 deletions.
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

0 comments on commit 0e5fe88

Please sign in to comment.