forked from zingolabs/zaino
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.toml
More file actions
169 lines (134 loc) · 6.21 KB
/
Copy pathMakefile.toml
File metadata and controls
169 lines (134 loc) · 6.21 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
extend = [
{ path = "tools/makefiles/lints.toml" },
{ path = "tools/makefiles/notify.toml" },
{ path = "tools/makefiles/rocksdb.toml" },
]
env_files = [".env.testing-artifacts"]
[config]
default_to_workspace = false
[env]
IMAGE_NAME = "zingodevops/zaino-ci"
TEST_BINARIES_DIR = "/home/container_user/artifacts"
CONTAINERS_CONF_OVERRIDE = "${CARGO_MAKE_WORKING_DIRECTORY}/.config/containers.conf"
# Single source of truth: rust-toolchain.toml's `channel`, extracted via
# tools/scripts/get-rust-version.sh. Replaces RUST_VERSION in
# .env.testing-artifacts.
RUST_VERSION = { script = ["./tools/scripts/get-rust-version.sh"] }
[tasks.help]
description = "List available commands and usage notes"
script_runner = "bash"
extend = "base-script"
script.main = 'source "./tools/scripts/help.sh"'
[tasks.base-script]
# The pre-script lives in tools/scripts/base-script-pre.sh and is *sourced*
# (not executed) so the TAG var, podman_cleanup function, and cleanup trap it
# defines stay in scope for each consuming task's script.main. cargo-make
# concatenates pre/main/post into one shell program, so sourcing keeps them in
# the same shell.
script_runner = "bash"
script.pre = 'source "./tools/scripts/base-script-pre.sh"'
script.main = "err 'default main script. define a proper script to skip this one'"
script.post = ""
# -------------------------------------------------------------------
[tasks.init-podman-volumes]
description = "Initialize named podman volumes for container builds"
script_runner = "bash"
script = 'source "./tools/scripts/init-podman-volumes.sh"'
# -------------------------------------------------------------------
[tasks.compute-image-tag]
description = "Compute image tag from version vars"
script_runner = "bash"
script = 'source "./tools/scripts/compute-image-tag.sh"'
# -------------------------------------------------------------------
[tasks.get-podman-hash]
description = "Get the current CONTAINER_DIR_HASH"
script_runner = "bash"
script = 'source "./tools/scripts/get-podman-hash.sh"'
[tasks.ensure-image-exists]
description = "Ensure the image exists locally, building if needed"
dependencies = ["init-podman-volumes"]
script_runner = "bash"
extend = "base-script"
script.main = 'source "./tools/scripts/ensure-image-exists.sh"'
# -------------------------------------------------------------------
[tasks.pull-ci-image]
description = "Pull the CI image from the registry"
extend = "base-script"
script.main = 'source "./tools/scripts/pull-ci-image.sh"'
# -------------------------------------------------------------------
[tasks.build-image]
description = "Build the container image for testing artifacts"
# Note: This task builds the container image from the integration-tests/test_environment
# directory, which contains the Containerfile and entrypoint.sh for the CI/test environment.
script_runner = "bash"
extend = "base-script"
script.main = 'source "./tools/scripts/build-image.sh"'
# -------------------------------------------------------------------
[tasks.push-image]
description = "Push image if running in CI"
# condition = { env_set = ["CI"] }
dependencies = ["ensure-image-exists"]
script_runner = "bash"
extend = "base-script"
script.main = 'source "./tools/scripts/push-image.sh"'
# -------------------------------------------------------------------
[tasks.container-test]
clear = true
description = "Run integration tests using the local image"
# This task runs tests inside the container built from integration-tests/test_environment.
# The entrypoint.sh script in the container sets up test binaries (zcashd, zebrad, zcash-cli)
# by creating symlinks from /home/container_user/artifacts to the expected integration-tests/test_binaries/bins location.
dependencies = ["init-podman-volumes", "ensure-image-exists"]
script_runner = "bash"
extend = "base-script"
script.main = 'source "./tools/scripts/container-test.sh"'
script.post = "makers notify"
# -------------------------------------------------------------------
[tasks.integration-test]
description = "Run the integration-tests sub-workspace inside the CI container (forwards extra args to `cargo nextest run`)"
script_runner = "bash"
extend = "base-script"
script.main = 'source "./tools/scripts/integration-test.sh"'
# -------------------------------------------------------------------
[tasks.check-matching-zebras]
description = "Check that zebra versions in .env.testing-artifacts match what's in Cargo.toml"
extend = "base-script"
script_runner = "bash"
script.main = 'source "./tools/scripts/check-matching-zebras.sh"'
# -------------------------------------------------------------------
[tasks.validate-makefile-tasks]
description = "Validate all tasks work correctly with minimal execution"
dependencies = ["init-podman-volumes"]
script_runner = "@rust"
script = { file = "tools/scripts/validate-makefile-tasks.rs" }
# -------------------------------------------------------------------
[tasks.validate-test-targets]
description = "Validate that nextest targets match CI workflow matrix"
script_runner = "bash"
extend = "base-script"
script.main = 'source "./tools/scripts/validate-test-targets.sh"'
# -------------------------------------------------------------------
[tasks.update-test-targets]
description = "Update CI workflow matrix to match nextest targets"
script_runner = "bash"
extend = "base-script"
script.main = 'source "./tools/scripts/update-test-targets.sh"'
# -------------------------------------------------------------------
[tasks.container-test-save-failures]
description = "Run container-test and save failed test names for later retry"
script_runner = "bash"
extend = "base-script"
script.main = 'source "./tools/scripts/container-test-save-failures.sh"'
script.post = "makers notify"
# -------------------------------------------------------------------
[tasks.container-test-retry-failures]
description = "Rerun only failed tests from previous container-test-save-failures"
script_runner = "bash"
extend = "base-script"
script.main = 'source "./tools/scripts/container-test-retry-failures.sh"'
script.post = "makers notify"
# -------------------------------------------------------------------
[tasks.verify-all]
description = "Exercise every Makefile.toml task for correctness (idempotent)"
script_runner = "bash"
script = 'source "./tools/scripts/verify-all.sh"'