forked from ava-labs/subnet-evm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
192 lines (156 loc) · 6.41 KB
/
Taskfile.yml
File metadata and controls
192 lines (156 loc) · 6.41 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# https://taskfile.dev
# To run on a system without task installed, `./scripts/run_task.sh` will execute it with `go run`.
# If in the nix dev shell, `task` is available.
version: '3'
env:
AVALANCHEGO_BUILD_PATH: '{{.AVALANCHEGO_BUILD_PATH | default "/tmp/e2e-test/avalanchego"}}'
tasks:
default: ./scripts/run_task.sh --list
actionlint:
desc: Validate GitHub Actions workflows and ensure scripts use run_task.sh for reproducibility
cmd: ./scripts/actionlint.sh # ci.yml
build:
desc: Compile Subnet EVM binary with git commit and static linking flags
cmd: ./scripts/build.sh # ci.yml
build-antithesis-images:
desc: Build Docker images for antithesis testing including avalanchego node and subnet-evm builder images
cmd: bash -x ./scripts/build_antithesis_images.sh # publish_antithesis_images.yml
build-bench-precompiles:
desc: Run benchmark tests for precompile contracts with timeout and coverage
cmd: ./scripts/build_bench_precompiles.sh # bench.yml
build-docker-image:
desc: Build multi-platform Docker image with avalanchego integration and optional publishing
cmd: ./scripts/build_docker_image.sh # publish_docker.yml
build-test:
desc: Run all Go tests with retry logic for flaky tests, race detection, and coverage reporting
cmd: ./scripts/build_test.sh # ci.yml
check-avalanchego-version:
desc: Ensure consistent avalanchego version by updating and checking for changes
cmds:
- task: update-avalanchego-version
- cmd: git diff --exit-code
check-clean-branch:
desc: Checks that the git working tree is clean
cmds:
- cmd: git add --all
- cmd: git update-index --really-refresh >> /dev/null
- cmd: git status --short # Show the status of the working tree.
- cmd: git diff-index --quiet HEAD # Exits if any uncommitted changes are found.
check-generate-codec:
desc: Checks that generated codec files are up-to-date (requires a clean git working tree)
cmds:
- task: generate-codec
- task: check-clean-branch
check-generate-mocks:
desc: Checks that generated mocks are up-to-date (requires a clean git working tree)
cmds:
- task: generate-mocks
- task: check-clean-branch
check-generate-rlp:
desc: Checks that generated rlp files are up-to-date (requires a clean git working tree)
cmds:
- task: generate-rlp
- task: check-clean-branch
check-generate-bindings:
desc: Checks that generated Go bindings from Solidity contracts in precompile are up-to-date (requires a clean git working tree)
cmds:
- task: generate-bindings
- task: check-clean-branch
check-go-mod-tidy:
desc: Checks that all go.mod and go.sum files are up-to-date (requires a clean git working tree)
cmds:
- cmd: go mod tidy
- task: check-clean-branch
- cmd: cd tools && go mod tidy
- task: check-clean-branch
coverage:
desc: Display test coverage statistics from coverage.out file
cmd: ./scripts/coverage.sh # ci.yml
generate-codec:
desc: Generates fjl/gencodec files
cmds:
- cmd: grep -lr -E '^// Code generated by github\.com\/fjl\/gencodec\. DO NOT EDIT\.$' . | xargs -r rm
- cmd: go generate -run gencodec ./...
generate-mocks:
desc: Generates testing mocks
cmds:
- cmd: grep -lr -E '^// Code generated by MockGen\. DO NOT EDIT\.$' . | xargs -r rm
- cmd: go generate -run mockgen ./...
generate-rlp:
desc: Generates rlp files
cmds:
- cmd: grep -lr -E '^// Code generated by rlpgen\. DO NOT EDIT.\.$' . | xargs -r rm
- cmd: go generate -run rlpgen ./...
generate-bindings:
desc: Generates Go bindings from Solidity contracts in precompile
cmds:
- cmd: |
# Find and remove generated binding files in precompile directories only
find ./precompile -type f -name 'gen_*binding.go' -exec grep -l '^// Code generated - DO NOT EDIT\.$' {} \; | xargs -r rm
- cmd: go generate ./precompile/...
install-avalanchego-release:
desc: Download and install AvalancheGo release binary for testing, with fallback to building from source
cmd: ./scripts/install_avalanchego_release.sh # ci.yml
lint:
desc: Run golangci-lint and check for allowed Ethereum imports in Go code
cmd: ./scripts/lint.sh
lint-all:
desc: Runs all lint checks in parallel
deps:
- lint
- actionlint
- shellcheck
- check-generate-codec
- check-generate-mocks
- check-generate-rlp
- check-generate-bindings
lint-all-ci:
desc: Runs all lint checks one-by-one
cmds:
- task: lint
- task: actionlint
- task: shellcheck
- task: check-generate-codec
- task: check-generate-mocks
- task: check-generate-rlp
- task: check-generate-bindings
lint-fix:
desc: Run golangci-lint with auto-fix where possible
cmd: ./scripts/lint_fix.sh
shellcheck:
desc: Run shellcheck static analysis on all shell scripts with version management
cmd: ./scripts/shellcheck.sh # ci.yml
test-build-antithesis-images:
desc: Test antithesis images build
cmd: bash -x scripts/tests.build_antithesis_images.sh
test-build-antithesis-images-ci: # consolidated test-build-antithesis-images
desc: Test antithesis images build with CI setup
cmds:
- task: install-avalanchego-release
- task: build
- cmd: go run ./tests/antithesis --avalanchego-path=/tmp/e2e-test/avalanchego/avalanchego --duration=60s
- task: test-build-antithesis-images
test-build-image:
desc: Test docker image build
cmd: bash -x scripts/tests.build_docker_image.sh # ci.yml
test-e2e-load:
desc: Run end-to-end load tests using Ginkgo test framework
cmd: ./scripts/run_ginkgo_load.sh # ci.yml
test-e2e-load-ci: # consolidated test-e2e-load
desc: Run E2E load tests with CI setup
cmds:
- task: install-avalanchego-release
- task: build
- task: test-e2e-load
test-e2e-warp:
desc: Run end-to-end warp tests using Ginkgo test framework
cmd: bash -x ./scripts/run_ginkgo_warp.sh # ci.yml
test-e2e-warp-ci: # consolidated test-e2e-warp
desc: Run E2E warp tests with CI setup
cmds:
- task: install-avalanchego-release
- task: build
- task: test-e2e-warp
update-avalanchego-version:
desc: Update AvalancheGo version in go.mod and sync GitHub Actions workflow custom action version
cmd: bash -x ./scripts/update_avalanchego_version.sh # ci.yml