-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
130 lines (102 loc) · 5.79 KB
/
Copy pathMakefile
File metadata and controls
130 lines (102 loc) · 5.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
.PHONY: generate-daml-codecs
generate-daml-codecs:
go run ./contracts/cmd/damlcodecs
.PHONY: compile-contracts
compile-contracts: generate-daml-codecs
@echo "Compiling contracts..."
dpm clean --all --multi-package-path ./contracts/
go run ./contracts/cmd/compile -root ./contracts -artifacts ./contracts/dars
.PHONY: generate-bindings
generate-bindings:
go run ./contracts/cmd/bindings
.PHONY: freeze-release
freeze-release: ## Freeze DARs into a versioned snapshot (bindings stay in latest/). Usage: make freeze-release VERSION=2.0.0
@test -n "$(VERSION)" || (echo "VERSION is required, e.g. make freeze-release VERSION=1.0.0" && exit 1)
@./contracts/scripts/freeze-release.sh $(VERSION)
.PHONY: check-frozen-release-artifacts
check-frozen-release-artifacts: ## Fail if the branch changes frozen release DARs or legacy v1_* bindings.
@chmod +x ./contracts/scripts/check-frozen-release-artifacts.sh
@./contracts/scripts/check-frozen-release-artifacts.sh
.PHONY: clean-codecs
clean-codecs: ## Remove auto-generated *CodecGen.daml files (regenerated by generate-daml-codecs).
@find contracts -path '*/daml/CCIP/*CodecGen.daml' -not -path '*/.daml/*' -delete 2>/dev/null || true
.PHONY: contracts
contracts: clean-codecs compile-contracts generate-bindings
.PHONY: update-contract-version
update-contract-version: ## Update contract version and rebuild. Usage: make update-contract-version OLD=0.0.1 NEW=1.0.0
@./contracts/scripts/update-version.sh $(OLD) $(NEW)
@$(MAKE) contracts
.PHONY: go-generate
go-generate:
go generate ./...
.PHONY: gomodtidy
gomodtidy: ## Run go mod tidy on all modules.
go run github.com/jmank88/gomods@v0.1.7 tidy
.PHONY: test-daml-contracts
test-daml-contracts:
go run ./contracts/cmd/test --root ./contracts
# GolangCI-Lint targets
.PHONY: golangci-lint-main golangci-lint-integration-tests golangci-lint-party-ceremony golangci-lint-party-ceremony-integration-tests
golangci-lint-main: ## Run golangci-lint on the main module.
golangci-lint run
golangci-lint-integration-tests: ## Run golangci-lint on the integration-tests module.
cd integration-tests && golangci-lint run
golangci-lint-party-ceremony: ## Run golangci-lint on the party-ceremony module.
cd party-ceremony && golangci-lint run
golangci-lint-party-ceremony-integration-tests: ## Run golangci-lint on the party-ceremony/integration-tests module.
cd party-ceremony/integration-tests && golangci-lint run
.PHONY: golangci-lint-all
golangci-lint-all: golangci-lint-main golangci-lint-integration-tests golangci-lint-party-ceremony golangci-lint-party-ceremony-integration-tests ## Run golangci-lint on all modules.
.PHONY: golangci-lint-fix-main golangci-lint-fix-integration-tests golangci-lint-fix-party-ceremony golangci-lint-fix-party-ceremony-integration-tests
golangci-lint-fix-main: ## Run golangci-lint --fix on the main module.
golangci-lint run --fix
golangci-lint-fix-integration-tests: ## Run golangci-lint --fix on the integration-tests module.
cd integration-tests && golangci-lint run --fix
golangci-lint-fix-party-ceremony: ## Run golangci-lint --fix on the party-ceremony module.
cd party-ceremony && golangci-lint run --fix
golangci-lint-fix-party-ceremony-integration-tests: ## Run golangci-lint --fix on the party-ceremony/integration-tests module.
cd party-ceremony/integration-tests && golangci-lint run --fix
.PHONY: golangci-lint-fix-all
golangci-lint-fix-all: golangci-lint-fix-main golangci-lint-fix-integration-tests golangci-lint-fix-party-ceremony golangci-lint-fix-party-ceremony-integration-tests ## Run golangci-lint --fix on all modules.
## Run all fix targets.
## Compiles contracts, generates bindings, runs all go generates, runs go mod tidy, and runs golangci-lint --fix on all modules.
.PHONY: fix-all
fix-all: contracts go-generate gomodtidy golangci-lint-fix-all
.PHONY: build-committeeverifier
build-committeeverifier:
docker build -t committeeverifier-canton:latest -f ccip/committee_verifier.Dockerfile .
.PHONY: build-eds
build-eds:
docker build -t canton-eds:latest -f eds/eds.Dockerfile .
## Assuming chainlink-ccv is checked out in ../chainlink-ccv.
.PHONY: build-ccv-images
build-ccv-images:
cd ../chainlink-ccv/build/devenv && just build-docker
.PHONY: start-devenv
start-devenv: build-ccv-images build-committeeverifier build-eds
cd ccip/devenv && go run cmd/ccv/main.go down && go run cmd/ccv/main.go up env-canton-evm.toml
.PHONY: run-e2e-tests
run-e2e-tests:
cd ccip/devenv/tests/e2e && go test -timeout 5m -v -count 1 -run TestEVM2Canton_Basic && go test -timeout 5m -v -count 1 -run 'TestCanton2EVM_(Basic|SendValidation)'
.PHONY: run-canton2evm-load
run-canton2evm-load: ## Canton→EVM WASP load (requires running devenv + env-canton-evm-out.toml).
cd ccip/devenv/tests/load && go test -timeout 15m -v -count 1 -run '^TestCanton2EVM_Load$$'
.PHONY: run-evm2canton-load
run-evm2canton-load: ## EVM→Canton WASP load (requires running devenv + env-canton-evm-out.toml).
cd ccip/devenv/tests/load && go test -timeout 15m -v -count 1 -run '^TestEVM2Canton_Load$$'
.PHONY: run-canton2evm-token-load
run-canton2evm-token-load: ## Canton→EVM token WASP load (requires running devenv + env-canton-evm-out.toml).
cd ccip/devenv/tests/load && go test -timeout 20m -v -count 1 -run '^TestCanton2EVM_TokenLoad$$'
.PHONY: run-evm2canton-token-load
run-evm2canton-token-load: ## EVM→Canton token WASP load (requires running devenv + env-canton-evm-out.toml).
cd ccip/devenv/tests/load && go test -timeout 20m -v -count 1 -run '^TestEVM2Canton_TokenLoad$$'
.PHONY: build-run-e2e-tests
build-run-e2e-tests: start-devenv run-e2e-tests
.PHONY: mocks
mocks:
go run github.com/vektra/mockery/v3@v3.7.0
.PHONY: git-generated-merge-config
git-generated-merge-config:
echo 'bindings/generated/** merge=ours' >> .git/info/attributes
echo 'contracts/dars/** merge=ours' >> .git/info/attributes
git config --local merge.ours.driver true