Upgrade to rust:1.89-debian-trixie-slim for much better workflow performance
- Replace debian:trixie with rust:1.89-debian-trixie-slim - Rust 1.89.0 is pre-installed and > 1.84.1 requirement - Eliminate complex rustup installation and toolchain management - Remove Cargo.lock version 4 regeneration logic (not needed with Rust 1.89.0) - Simplify setup steps and reduce build time - Update environment variables and build info to reflect new container - Both workflows now use the same optimized approach
This commit is contained in:
parent
4a88e5824c
commit
4c71e145d4
2 changed files with 31 additions and 64 deletions
|
|
@ -24,16 +24,16 @@ on:
|
|||
|
||||
env:
|
||||
DEBIAN_VERSION: "13 (Trixie)"
|
||||
RUST_VERSION: "1.84.1"
|
||||
RUST_VERSION: "1.89.0"
|
||||
|
||||
jobs:
|
||||
build-artifacts:
|
||||
name: Build deb-bootupd Artifacts
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
# Use Debian 13 (Trixie) since this is a Debian-focused project
|
||||
# Note: debian:trixie is the correct tag for Debian 13
|
||||
image: debian:trixie
|
||||
# Use official Rust image with Debian Trixie base - much better than manual Rust setup
|
||||
# Rust 1.89.0 is pre-installed and > 1.84.1 requirement
|
||||
image: rust:1.89-debian-trixie-slim
|
||||
steps:
|
||||
- name: Setup build environment
|
||||
shell: bash
|
||||
|
|
@ -41,36 +41,19 @@ jobs:
|
|||
apt update -y
|
||||
apt install -y git curl pkg-config build-essential gnupg
|
||||
|
||||
# Install system Rust packages first for dpkg-buildpackage compatibility
|
||||
apt install -y rustc cargo
|
||||
|
||||
# Install Rust using rustup to get the latest version
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||
. ~/.cargo/env
|
||||
|
||||
# Install and use the latest nightly toolchain
|
||||
rustup toolchain install nightly
|
||||
rustup default nightly
|
||||
rustup update
|
||||
|
||||
# Verify we have a recent enough version
|
||||
# Rust 1.89.0 is already installed in rust:1.89-debian-trixie-slim
|
||||
# No need for rustup or toolchain management!
|
||||
echo "✅ Using pre-installed Rust from official image:"
|
||||
rustc --version
|
||||
cargo --version
|
||||
|
||||
# Check if Rust version meets requirements (need 1.84.1+)
|
||||
# Verify Rust version meets requirements (need 1.84.1+)
|
||||
RUST_VERSION=$(rustc --version | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+' | head -1)
|
||||
echo "Extracted Rust version: $RUST_VERSION"
|
||||
echo "Rust version: $RUST_VERSION"
|
||||
|
||||
# Verify minimum version requirement
|
||||
if [ "$(printf '%s\n' "1.84.1" "$RUST_VERSION" | sort -V | head -n1)" != "1.84.1" ]; then
|
||||
echo "❌ Rust version $RUST_VERSION is too old, need 1.84.1+"
|
||||
echo "Available toolchains:"
|
||||
rustup toolchain list
|
||||
echo "Installing latest nightly..."
|
||||
rustup toolchain install nightly --force
|
||||
rustup default nightly
|
||||
rustup update
|
||||
rustc --version
|
||||
exit 1
|
||||
else
|
||||
echo "✅ Rust version $RUST_VERSION meets requirement (1.84.1+)"
|
||||
fi
|
||||
|
|
@ -102,18 +85,12 @@ jobs:
|
|||
echo "Cargo.toml contents:"
|
||||
cat Cargo.toml
|
||||
|
||||
# Check Cargo.lock version and regenerate if needed
|
||||
# Check Cargo.lock version
|
||||
echo "Cargo.lock version:"
|
||||
head -n 1 Cargo.lock
|
||||
|
||||
# If Cargo.lock version is too new, regenerate it
|
||||
if grep -q "version = 4" Cargo.lock; then
|
||||
echo "Cargo.lock version 4 detected, regenerating with nightly toolchain..."
|
||||
rm Cargo.lock
|
||||
cargo generate-lockfile
|
||||
echo "New Cargo.lock generated:"
|
||||
head -n 1 Cargo.lock
|
||||
fi
|
||||
# Rust 1.89.0 should handle any Cargo.lock version without issues
|
||||
echo "Using Rust 1.89.0 - should handle all Cargo.lock versions"
|
||||
|
||||
# Build in release mode
|
||||
echo "Building deb-bootupd in release mode..."
|
||||
|
|
@ -168,6 +145,7 @@ jobs:
|
|||
=============================
|
||||
Build Date: $(date)
|
||||
Debian Version: ${DEBIAN_VERSION}
|
||||
Container Image: rust:1.89-debian-trixie-slim
|
||||
Rust Version: $(rustc --version)
|
||||
Cargo Version: $(cargo --version)
|
||||
Git Commit: $(git rev-parse --short HEAD)
|
||||
|
|
@ -240,6 +218,7 @@ jobs:
|
|||
=========================
|
||||
Build Date: $(date)
|
||||
Debian Version: ${DEBIAN_VERSION}
|
||||
Container Image: rust:1.89-debian-trixie-slim
|
||||
Rust Version: $(rustc --version)
|
||||
Git Commit: $(git rev-parse --short HEAD)
|
||||
Git Branch: $(git branch --show-current)
|
||||
|
|
|
|||
|
|
@ -14,23 +14,20 @@ jobs:
|
|||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
# Use Debian 13 (Trixie) since this is a Debian-focused project
|
||||
# Note: debian:trixie is the correct tag for Debian 13
|
||||
image: debian:trixie
|
||||
# Use official Rust image with Debian Trixie base - much better than manual Rust setup
|
||||
# Rust 1.89.0 is pre-installed and > 1.84.1 requirement
|
||||
image: rust:1.89-debian-trixie-slim
|
||||
steps:
|
||||
- name: Checkout code and setup environment
|
||||
run: |
|
||||
apt update -y
|
||||
apt install -y git curl pkg-config libssl-dev libsystemd-dev build-essential
|
||||
|
||||
# Install Rust using rustup
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||
. ~/.cargo/env
|
||||
|
||||
# Install and use the latest nightly toolchain
|
||||
rustup toolchain install nightly
|
||||
rustup default nightly
|
||||
rustup update
|
||||
# Rust 1.89.0 is already installed in rust:1.89-debian-trixie-slim
|
||||
# No need for rustup or toolchain management!
|
||||
echo "✅ Using pre-installed Rust from official image:"
|
||||
rustc --version
|
||||
cargo --version
|
||||
|
||||
# Clone repository
|
||||
git clone https://git.raines.xyz/robojerk/deb-bootupd.git /tmp/deb-bootupd
|
||||
|
|
@ -40,31 +37,22 @@ jobs:
|
|||
echo "Branch: $(git branch --show-current)"
|
||||
echo "Commit: $(git rev-parse --short HEAD)"
|
||||
|
||||
# Verify Rust and check version requirements
|
||||
echo "Rust version: $(rustc --version)"
|
||||
echo "Cargo version: $(cargo --version)"
|
||||
|
||||
# Check if Rust version meets requirements (need 1.84.1+)
|
||||
# Verify Rust version meets requirements (need 1.84.1+)
|
||||
RUST_VERSION=$(rustc --version | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+' | head -1)
|
||||
echo "Extracted Rust version: $RUST_VERSION"
|
||||
echo "Rust version: $RUST_VERSION"
|
||||
|
||||
# Verify minimum version requirement
|
||||
if [ "$(printf '%s\n' "1.84.1" "$RUST_VERSION" | sort -V | head -n1)" != "1.84.1" ]; then
|
||||
echo "❌ Rust version $RUST_VERSION is too old, need 1.84.1+"
|
||||
echo "Available toolchains:"
|
||||
rustup toolchain list
|
||||
echo "Installing latest nightly..."
|
||||
rustup toolchain install nightly --force
|
||||
rustup default nightly
|
||||
rustup update
|
||||
rustc --version
|
||||
exit 1
|
||||
else
|
||||
echo "✅ Rust version $RUST_VERSION meets requirement (1.84.1+)"
|
||||
fi
|
||||
|
||||
# Set PATH for subsequent steps
|
||||
echo "export PATH=$HOME/.cargo/bin:$PATH" >> $GITHUB_ENV
|
||||
echo "export CARGO_HOME=$HOME/.cargo" >> $GITHUB_ENV
|
||||
# Rust environment is already set up in the container
|
||||
echo "Rust environment ready:"
|
||||
echo "RUSTUP_HOME: $RUSTUP_HOME"
|
||||
echo "CARGO_HOME: $CARGO_HOME"
|
||||
echo "PATH includes: $PATH"
|
||||
|
||||
- name: Build project
|
||||
run: |
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue