]> xenbits.xensource.com Git - xen-guest-agent.git/commitdiff
ci: specify Linux Rust toolchain versions to build with
authorYann Dirson <yann.dirson@vates.tech>
Fri, 4 Oct 2024 14:31:26 +0000 (16:31 +0200)
committerYann Dirson <yann.dirson@vates.tech>
Fri, 4 Oct 2024 18:11:12 +0000 (20:11 +0200)
- test builds: minimum supported version (1.74)
- release builds: explicit most recent version for which a buster
  docker image exists (1.79)
- code checks: latest

.gitlab-ci.yml

index 85cd182171c494d26fcf069947e2c861b3ba2f53..b3b24f4ef66787c7693d70df3c429718d7ad8037 100644 (file)
@@ -16,7 +16,9 @@ workflow:
     - if: $CI_COMMIT_TAG
 
 variables:
-  LINUX_RUSTIMG: "docker.io/library/rust:buster"
+  RUST_MIN_VERSION: "1.74-buster"
+  RUST_REL_VERSION: "1.79-buster"
+  LINUX_RUSTIMG: "docker.io/library/rust:${RUST_VERSION}"
   PKG_ROOT: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic"
 
 .build-template:
@@ -35,6 +37,7 @@ variables:
     - apt-get update
     - apt-get install -y llvm-dev clang libxen-dev
 
+# FIXME does not allow to pin a toolchain version
 .cross-build-template:
   extends:
     - .build-template
@@ -91,6 +94,8 @@ clippy:
   stage: check
   extends:
     - .debian-build-template
+  variables:
+    RUST_VERSION: "latest"
   before_script:
     - !reference [.debian-build-template,before_script]
     - rustup component add clippy
@@ -101,6 +106,8 @@ cargo-lock:
   stage: check
   extends:
     - .debian-build-template
+  variables:
+    RUST_VERSION: "${RUST_REL_VERSION}"
   script:
     - cargo tree
     # if Cargo.lock was not commited, this will show here
@@ -186,6 +193,7 @@ build-linux-everycommit:
     - .debian-build-template
   variables:
     CARGO_FLAGS: "-v"
+    RUST_VERSION: "${RUST_MIN_VERSION}"
   before_script:
     - printf "\e[0Ksection_start:$(date +%s):before_script[collapsed=true]\r\e[0K\e[1;33mBuild setup\e[1;0m\n"
     - !reference [.debian-build-template,before_script]
@@ -208,6 +216,7 @@ build-linux:
     - .debian-build-template
   variables:
     CARGO_FLAGS: "-v"
+    RUST_VERSION: "${RUST_MIN_VERSION}"
   rules:
     - if: $CI_PIPELINE_SOURCE == "merge_request_event"
       # building branch tip already included in 'everycommit'
@@ -222,6 +231,7 @@ build-release-linux-x86_64:
   variables:
     FEATURES: "-F static"
     CARGO_FLAGS: "--release"
+    RUST_VERSION: "${RUST_REL_VERSION}"
   artifacts:
     paths:
       - target/release/xen-guest-agent
@@ -300,6 +310,7 @@ build-latest-linux:
     - .scheduled
   variables:
     CARGO_FLAGS: "-v"
+    RUST_VERSION: "${RUST_MIN_VERSION}"
   before_script:
     - !reference [".debian-build-template", "before_script"]
     - mv Cargo.lock Cargo.lock.current
@@ -332,6 +343,8 @@ build-latest-freebsd13-x86_64:
 pkg-source:
   stage: package
   image: ${LINUX_RUSTIMG}
+  variables:
+    RUST_VERSION: "latest"
   extends:
     - .not-scheduled
   needs: