ci: route test jobs to self-hosted runner with persistent CARGO_TARGET_DIR

- Add tags: [pezkuwi-runner] to .test-base, wasm-check, test-doc
- Set CARGO_TARGET_DIR to /var/cache/cargo-target/<hash>/<job-name> on VPS2
- Hash is md5(Cargo.lock + rust-toolchain.toml) — auto-deletes old keys
- Set CARGO_HOME: /root/.cargo (persistent volume, skip GitLab cache upload)
- Disable GitLab registry cache for self-hosted jobs (cache: [])
- Fix basic-authorship doc test: mark as no_run (requires compiled WASM at runtime)
This commit is contained in:
Kurdistan Tech Ministry committed 2026-04-24 17:24:34 +03:00
1 parent 578190da50
commit b99f16f934
2 files changed
+38 -2

No files matched your search

+37 -1
View File
@@ -256,11 +256,23 @@ cargo-audit:
# Tests split into 3 partitions via cargo-nextest — mirrors GitHub matrix strategy # Tests split into 3 partitions via cargo-nextest — mirrors GitHub matrix strategy
.test-base: .test-base:
stage: test stage: test
tags: [pezkuwi-runner]
needs: [clippy, check-try-runtime] needs: [clippy, check-try-runtime]
variables: variables:
CARGO_HOME: /root/.cargo
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings" RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
WASM_BUILD_NO_COLOR: "1" WASM_BUILD_NO_COLOR: "1"
CARGO_INCREMENTAL: "0" CARGO_INCREMENTAL: "0"
before_script:
- rustup show
- rustc --version && cargo --version
- rustup target add wasm32v1-none
- export CACHE_KEY="$(cat Cargo.lock rust-toolchain.toml | md5sum | cut -c1-12)"
- export CARGO_TARGET_DIR="/var/cache/cargo-target/${CACHE_KEY}/${CI_JOB_NAME}"
- mkdir -p "$CARGO_TARGET_DIR"
- find /var/cache/cargo-target -mindepth 1 -maxdepth 1 -type d ! -name "${CACHE_KEY}" -exec rm -rf {} + 2>/dev/null || true
- echo "CARGO_TARGET_DIR=$CARGO_TARGET_DIR (disk $(df -h /var/cache/cargo-target | tail -1 | awk '{print $3 "/" $2 " used, " $4 " free"}'))"
cache: []
timeout: 90m timeout: 90m
rules: rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
@@ -340,7 +352,20 @@ test-no-try-runtime-2:
wasm-check: wasm-check:
stage: test stage: test
tags: [pezkuwi-runner]
needs: [check-try-runtime] needs: [check-try-runtime]
variables:
CARGO_HOME: /root/.cargo
before_script:
- rustup show
- rustc --version && cargo --version
- rustup target add wasm32v1-none
- export CACHE_KEY="$(cat Cargo.lock rust-toolchain.toml | md5sum | cut -c1-12)"
- export CARGO_TARGET_DIR="/var/cache/cargo-target/${CACHE_KEY}/${CI_JOB_NAME}"
- mkdir -p "$CARGO_TARGET_DIR"
- find /var/cache/cargo-target -mindepth 1 -maxdepth 1 -type d ! -name "${CACHE_KEY}" -exec rm -rf {} + 2>/dev/null || true
- echo "CARGO_TARGET_DIR=$CARGO_TARGET_DIR"
cache: []
script: script:
- cargo check -p pezkuwichain-runtime --locked --target wasm32v1-none - cargo check -p pezkuwichain-runtime --locked --target wasm32v1-none
rules: rules:
@@ -372,13 +397,24 @@ runtime-migration:
test-doc: test-doc:
stage: docs stage: docs
tags: [pezkuwi-runner]
needs: [clippy] needs: [clippy]
variables: variables:
CARGO_HOME: /root/.cargo
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings" RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
SKIP_WASM_BUILD: "0" SKIP_WASM_BUILD: "0"
before_script:
- rustup show
- rustc --version && cargo --version
- rustup target add wasm32v1-none
- export CACHE_KEY="$(cat Cargo.lock rust-toolchain.toml | md5sum | cut -c1-12)"
- export CARGO_TARGET_DIR="/var/cache/cargo-target/${CACHE_KEY}/${CI_JOB_NAME}"
- mkdir -p "$CARGO_TARGET_DIR"
- find /var/cache/cargo-target -mindepth 1 -maxdepth 1 -type d ! -name "${CACHE_KEY}" -exec rm -rf {} + 2>/dev/null || true
- echo "CARGO_TARGET_DIR=$CARGO_TARGET_DIR"
cache: []
timeout: 5h timeout: 5h
script: script:
- rustup target add wasm32v1-none
- git config --global --add safe.directory '*' - git config --global --add safe.directory '*'
- | - |
cargo test --doc --workspace --locked --all-features \ cargo test --doc --workspace --locked --all-features \
@@ -20,7 +20,7 @@
//! //!
//! # Example //! # Example
//! //!
//! ``` //! ```no_run
//! # use pezsc_basic_authorship::ProposerFactory; //! # use pezsc_basic_authorship::ProposerFactory;
//! # use pezsp_consensus::{Environment, Proposer}; //! # use pezsp_consensus::{Environment, Proposer};
//! # use pezsp_runtime::generic::BlockId; //! # use pezsp_runtime::generic::BlockId;