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 fa70374 commit 263c168
Show file tree
Hide file tree
Showing 12 changed files with 221 additions and 65 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/relay.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,14 @@ jobs:
check-latest: true
- 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 --stat --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 @@ -88,9 +88,25 @@ test_ocr_soak:
cd ./integration-tests &&\
SELECTED_NETWORKS=SIMULATED go test -timeout 24h -count=1 -json $(args) ./soak 2>&1 | tee /tmp/gotest.log | gotestfmt

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.

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

39 changes: 33 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 263c168

Please sign in to comment.