Skip to content

Commit 3e04ae7

Browse files
authored
rusty-cachier pipeline impovements and fixes (paritytech#11572)
1 parent 06f8647 commit 3e04ae7

File tree

3 files changed

+21
-10
lines changed

3 files changed

+21
-10
lines changed

.gitlab-ci.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ default:
108108
- $(rusty-cachier environment inject)
109109
- rusty-cachier project mtime
110110
after_script:
111-
- rusty-cachier snapshot destroy
111+
- env RUSTY_CACHIER_SUPRESS_OUTPUT=true rusty-cachier snapshot destroy
112112

113113
.test-refs:
114114
rules:
@@ -225,8 +225,7 @@ deploy-prometheus-alerting-rules:
225225
# This info is later used for the cache distribution and an overlay creation.
226226
rusty-cachier-notify:
227227
stage: notify
228-
extends:
229-
- .docker-env
228+
extends: .docker-env
230229
script:
231230
- rusty-cachier cache notify
232231

scripts/ci/gitlab/pipeline/build.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ build-linux-substrate:
5050
- .collect-artifacts
5151
- .docker-env
5252
- .build-refs
53+
variables:
54+
# this variable gets overriden by "rusty-cachier environment inject", use the value as default
55+
CARGO_TARGET_DIR: "./target"
5356
needs:
5457
- job: test-linux-stable
5558
artifacts: false
@@ -59,7 +62,7 @@ build-linux-substrate:
5962
script:
6063
- rusty-cachier snapshot create
6164
- WASM_BUILD_NO_COLOR=1 time cargo build --release --verbose
62-
- mv /cargo_target_dir/release/substrate ./artifacts/substrate/.
65+
- mv $CARGO_TARGET_DIR/release/substrate ./artifacts/substrate/.
6366
- echo -n "Substrate version = "
6467
- if [ "${CI_COMMIT_TAG}" ]; then
6568
echo "${CI_COMMIT_TAG}" | tee ./artifacts/substrate/VERSION;
@@ -79,6 +82,9 @@ build-linux-substrate:
7982
- .collect-artifacts
8083
- .docker-env
8184
- .build-refs
85+
variables:
86+
# this variable gets overriden by "rusty-cachier environment inject", use the value as default
87+
CARGO_TARGET_DIR: "./target"
8288
needs:
8389
- job: cargo-check-subkey
8490
artifacts: false
@@ -90,7 +96,7 @@ build-linux-substrate:
9096
- cd ./bin/utils/subkey
9197
- SKIP_WASM_BUILD=1 time cargo build --release --verbose
9298
- cd -
93-
- mv /cargo_target_dir/release/subkey ./artifacts/subkey/.
99+
- mv $CARGO_TARGET_DIR/release/subkey ./artifacts/subkey/.
94100
- echo -n "Subkey version = "
95101
- ./artifacts/subkey/subkey --version |
96102
sed -n -E 's/^subkey ([0-9.]+.*)/\1/p' |
@@ -131,6 +137,8 @@ build-rustdoc:
131137
SKIP_WASM_BUILD: 1
132138
DOC_INDEX_PAGE: "sc_service/index.html" # default redirected page
133139
RUSTY_CACHIER_TOOLCHAIN: nightly
140+
# this variable gets overriden by "rusty-cachier environment inject", use the value as default
141+
CARGO_TARGET_DIR: "./target"
134142
artifacts:
135143
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}-doc"
136144
when: on_success
@@ -140,8 +148,8 @@ build-rustdoc:
140148
script:
141149
- rusty-cachier snapshot create
142150
- time cargo +nightly doc --workspace --all-features --verbose
143-
- rm -f /cargo_target_dir/doc/.lock
144-
- mv /cargo_target_dir/doc ./crate-docs
151+
- rm -f $CARGO_TARGET_DIR/doc/.lock
152+
- mv $CARGO_TARGET_DIR/doc ./crate-docs
145153
# FIXME: remove me after CI image gets nonroot
146154
- chown -R nonroot:nonroot ./crate-docs
147155
- echo "<meta http-equiv=refresh content=0;url=${DOC_INDEX_PAGE}>" > ./crate-docs/index.html

scripts/ci/gitlab/pipeline/test.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,18 +180,22 @@ test-deterministic-wasm:
180180
- .test-refs
181181
variables:
182182
WASM_BUILD_NO_COLOR: 1
183+
# this variable gets overriden by "rusty-cachier environment inject", use the value as default
184+
CARGO_TARGET_DIR: "./target"
183185
script:
184186
- rusty-cachier snapshot create
185187
# build runtime
186188
- cargo build --verbose --release -p node-runtime
187189
# make checksum
188-
- sha256sum /cargo_target_dir/release/wbuild/node-runtime/target/wasm32-unknown-unknown/release/node_runtime.wasm > checksum.sha256
189-
# clean up – FIXME: can we reuse some of the artifacts?
190-
- cargo clean
190+
- sha256sum $CARGO_TARGET_DIR/release/wbuild/node-runtime/target/wasm32-unknown-unknown/release/node_runtime.wasm > checksum.sha256
191+
# clean up
192+
- rm -rf $CARGO_TARGET_DIR/release/wbuild
191193
# build again
192194
- cargo build --verbose --release -p node-runtime
193195
# confirm checksum
194196
- sha256sum -c ./checksum.sha256
197+
# clean up again, don't put release binaries into the cache
198+
- rm -rf $CARGO_TARGET_DIR/release/wbuild
195199
- rusty-cachier cache upload
196200

197201
test-linux-stable:

0 commit comments

Comments
 (0)