Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
39468740c3
|
@@ -155,11 +155,17 @@ steps inside one gate cannot protect against an independent process.
|
|||||||
|
|
||||||
### Prerequisites and reports
|
### Prerequisites and reports
|
||||||
|
|
||||||
Both pipelines use `bash scripts/provision-quality-gate.sh`. A Debian/Ubuntu
|
Jenkins uses `bash scripts/check-quality-gate-prerequisites.sh` to validate an
|
||||||
agent needs root or sudo for apt provisioning, and an existing Rust/rustup
|
already provisioned agent. The job does not install system packages, Rust
|
||||||
installation. GitHub installs stable Rust first; Jenkins must supply a supported
|
components or Cargo tools and does not require root or sudo. The agent image
|
||||||
Rust toolchain and rustup in CARGO_HOME/bin. The script installs rustfmt, Clippy,
|
must supply a supported Rust toolchain and rustup in CARGO_HOME/bin, rustfmt,
|
||||||
llvm-tools-preview and pinned cargo-llvm-cov 0.8.5 (`--locked`).
|
Clippy, llvm-tools-preview and pinned cargo-llvm-cov 0.8.5.
|
||||||
|
|
||||||
|
Provision the Jenkins agent before running jobs. The standalone
|
||||||
|
`bash scripts/provision-quality-gate.sh` helper requires root or sudo on
|
||||||
|
Debian/Ubuntu and an existing Rust/rustup installation; run it during agent
|
||||||
|
setup, with Rust tools installed for the job user. GitHub's disposable hosted
|
||||||
|
runner still uses this helper after installing stable Rust.
|
||||||
|
|
||||||
Linux packages include build-essential, pkg-config, libasound2-dev, libudev-dev,
|
Linux packages include build-essential, pkg-config, libasound2-dev, libudev-dev,
|
||||||
libxkbcommon-dev, libwayland-dev, libx11-dev, libxrandr-dev, libxi-dev, Python 3,
|
libxkbcommon-dev, libwayland-dev, libx11-dev, libxrandr-dev, libxi-dev, Python 3,
|
||||||
@@ -176,10 +182,10 @@ status; the log preserves underlying Cargo diagnostics. Three regression cases
|
|||||||
check failure logs/identity, fresh success evidence and partial-report retention
|
check failure logs/identity, fresh success evidence and partial-report retention
|
||||||
when a later gate fails.
|
when a later gate fails.
|
||||||
|
|
||||||
Both pipelines discard old generated report directories before provisioning and
|
Both pipelines discard old generated report directories before environment checks or setup and
|
||||||
publish current artifacts even after gate failure. An early failed gate has
|
publish current artifacts even after gate failure. An early failed gate has
|
||||||
metadata/logs but no old coverage report. Failure after generation preserves the
|
metadata/logs but no old coverage report. Failure after generation preserves the
|
||||||
partial current reports. Provisioning failure can leave no report at all and
|
partial current reports. Prerequisite or setup failure can leave no report at all and
|
||||||
still fails CI. Reports are archived from `target/quality-gate/**` and
|
still fails CI. Reports are archived from `target/quality-gate/**` and
|
||||||
`target/llvm-cov/**`; Jenkins also publishes current HTML when present. Artifact
|
`target/llvm-cov/**`; Jenkins also publishes current HTML when present. Artifact
|
||||||
publication does not turn a failed gate into success.
|
publication does not turn a failed gate into success.
|
||||||
|
|||||||
Vendored
+2
-2
@@ -14,12 +14,12 @@ pipeline {
|
|||||||
dir('target/llvm-cov') { deleteDir() }
|
dir('target/llvm-cov') { deleteDir() }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Provision') {
|
stage('Check prerequisites') {
|
||||||
steps {
|
steps {
|
||||||
sh '''
|
sh '''
|
||||||
set -eu
|
set -eu
|
||||||
export PATH="$CARGO_HOME/bin:$PATH"
|
export PATH="$CARGO_HOME/bin:$PATH"
|
||||||
bash scripts/provision-quality-gate.sh
|
bash scripts/check-quality-gate-prerequisites.sh
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Validate an already provisioned agent; never install dependencies in Jenkins.
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
fail() {
|
||||||
|
echo "Quality-gate prerequisite missing: $*. Provision the agent image before running this job." >&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
for command in rustup cargo rustc python3 jq rg git make pkg-config; do
|
||||||
|
command -v "$command" >/dev/null || fail "$command"
|
||||||
|
done
|
||||||
|
|
||||||
|
components=$(rustup component list --installed)
|
||||||
|
for component in rustfmt clippy llvm-tools-preview; do
|
||||||
|
if ! grep -Eq "^${component}(-|$)" <<< "$components"; then
|
||||||
|
fail "Rust component $component"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
[[ "$(cargo llvm-cov --version 2>/dev/null || true)" == 'cargo-llvm-cov 0.8.5' ]] || fail 'cargo-llvm-cov 0.8.5'
|
||||||
|
if [[ "$(uname -s)" == Linux ]]; then
|
||||||
|
pkg-config --exists alsa || fail 'ALSA development files (libasound2-dev)'
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user