ci: run lesavka pipeline on rust kubernetes agent
This commit is contained in:
parent
890146dcca
commit
481b0072ad
69
Jenkinsfile
vendored
69
Jenkinsfile
vendored
@ -1,5 +1,29 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent {
|
||||||
|
kubernetes {
|
||||||
|
label 'lesavka-tests'
|
||||||
|
defaultContainer 'rust-ci'
|
||||||
|
yaml """
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
spec:
|
||||||
|
nodeSelector:
|
||||||
|
kubernetes.io/arch: arm64
|
||||||
|
node-role.kubernetes.io/worker: "true"
|
||||||
|
containers:
|
||||||
|
- name: rust-ci
|
||||||
|
image: rust:1.82-bookworm
|
||||||
|
command: ["cat"]
|
||||||
|
tty: true
|
||||||
|
volumeMounts:
|
||||||
|
- name: workspace-volume
|
||||||
|
mountPath: /home/jenkins/agent
|
||||||
|
volumes:
|
||||||
|
- name: workspace-volume
|
||||||
|
emptyDir: {}
|
||||||
|
"""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
options {
|
options {
|
||||||
disableConcurrentBuilds()
|
disableConcurrentBuilds()
|
||||||
@ -26,33 +50,66 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stage('Bootstrap CI Toolchain') {
|
||||||
|
steps {
|
||||||
|
container('rust-ci') {
|
||||||
|
sh '''
|
||||||
|
set -eu
|
||||||
|
apt-get update
|
||||||
|
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
||||||
|
python3 \
|
||||||
|
curl \
|
||||||
|
clang \
|
||||||
|
llvm \
|
||||||
|
pkg-config \
|
||||||
|
libssl-dev \
|
||||||
|
ca-certificates
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
if ! cargo llvm-cov --version >/dev/null 2>&1; then
|
||||||
|
cargo install --locked cargo-llvm-cov
|
||||||
|
fi
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
stage('Format') {
|
stage('Format') {
|
||||||
steps {
|
steps {
|
||||||
sh 'cargo fmt --all -- --check'
|
container('rust-ci') {
|
||||||
|
sh 'cargo fmt --all -- --check'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Hygiene') {
|
stage('Hygiene') {
|
||||||
steps {
|
steps {
|
||||||
sh 'scripts/ci/hygiene_gate.sh'
|
container('rust-ci') {
|
||||||
|
sh 'scripts/ci/hygiene_gate.sh'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Testing') {
|
stage('Testing') {
|
||||||
steps {
|
steps {
|
||||||
sh 'cargo test -p lesavka_testing'
|
container('rust-ci') {
|
||||||
|
sh 'cargo test -p lesavka_testing'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Quality Gate') {
|
stage('Quality Gate') {
|
||||||
steps {
|
steps {
|
||||||
sh 'QUALITY_GATE_PUSHGATEWAY_URL="${QUALITY_GATE_PUSHGATEWAY_URL}" scripts/ci/quality_gate.sh'
|
container('rust-ci') {
|
||||||
|
sh 'QUALITY_GATE_PUSHGATEWAY_URL="${QUALITY_GATE_PUSHGATEWAY_URL}" scripts/ci/quality_gate.sh'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Build Dist') {
|
stage('Build Dist') {
|
||||||
steps {
|
steps {
|
||||||
sh 'scripts/ci/build-dist.sh'
|
container('rust-ci') {
|
||||||
|
sh 'scripts/ci/build-dist.sh'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user