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:
|
env:
|
||||||
DEBIAN_VERSION: "13 (Trixie)"
|
DEBIAN_VERSION: "13 (Trixie)"
|
||||||
RUST_VERSION: "1.84.1"
|
RUST_VERSION: "1.89.0"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-artifacts:
|
build-artifacts:
|
||||||
name: Build deb-bootupd Artifacts
|
name: Build deb-bootupd Artifacts
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
# Use Debian 13 (Trixie) since this is a Debian-focused project
|
# Use official Rust image with Debian Trixie base - much better than manual Rust setup
|
||||||
# Note: debian:trixie is the correct tag for Debian 13
|
# Rust 1.89.0 is pre-installed and > 1.84.1 requirement
|
||||||
image: debian:trixie
|
image: rust:1.89-debian-trixie-slim
|
||||||
steps:
|
steps:
|
||||||
- name: Setup build environment
|
- name: Setup build environment
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
@ -41,36 +41,19 @@ jobs:
|
||||||
apt update -y
|
apt update -y
|
||||||
apt install -y git curl pkg-config build-essential gnupg
|
apt install -y git curl pkg-config build-essential gnupg
|
||||||
|
|
||||||
# Install system Rust packages first for dpkg-buildpackage compatibility
|
# Rust 1.89.0 is already installed in rust:1.89-debian-trixie-slim
|
||||||
apt install -y rustc cargo
|
# No need for rustup or toolchain management!
|
||||||
|
echo "✅ Using pre-installed Rust from official image:"
|
||||||
# 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
|
|
||||||
rustc --version
|
rustc --version
|
||||||
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)
|
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
|
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 "❌ Rust version $RUST_VERSION is too old, need 1.84.1+"
|
||||||
echo "Available toolchains:"
|
exit 1
|
||||||
rustup toolchain list
|
|
||||||
echo "Installing latest nightly..."
|
|
||||||
rustup toolchain install nightly --force
|
|
||||||
rustup default nightly
|
|
||||||
rustup update
|
|
||||||
rustc --version
|
|
||||||
else
|
else
|
||||||
echo "✅ Rust version $RUST_VERSION meets requirement (1.84.1+)"
|
echo "✅ Rust version $RUST_VERSION meets requirement (1.84.1+)"
|
||||||
fi
|
fi
|
||||||
|
|
@ -102,18 +85,12 @@ jobs:
|
||||||
echo "Cargo.toml contents:"
|
echo "Cargo.toml contents:"
|
||||||
cat Cargo.toml
|
cat Cargo.toml
|
||||||
|
|
||||||
# Check Cargo.lock version and regenerate if needed
|
# Check Cargo.lock version
|
||||||
echo "Cargo.lock version:"
|
echo "Cargo.lock version:"
|
||||||
head -n 1 Cargo.lock
|
head -n 1 Cargo.lock
|
||||||
|
|
||||||
# If Cargo.lock version is too new, regenerate it
|
# Rust 1.89.0 should handle any Cargo.lock version without issues
|
||||||
if grep -q "version = 4" Cargo.lock; then
|
echo "Using Rust 1.89.0 - should handle all Cargo.lock versions"
|
||||||
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
|
|
||||||
|
|
||||||
# Build in release mode
|
# Build in release mode
|
||||||
echo "Building deb-bootupd in release mode..."
|
echo "Building deb-bootupd in release mode..."
|
||||||
|
|
@ -168,6 +145,7 @@ jobs:
|
||||||
=============================
|
=============================
|
||||||
Build Date: $(date)
|
Build Date: $(date)
|
||||||
Debian Version: ${DEBIAN_VERSION}
|
Debian Version: ${DEBIAN_VERSION}
|
||||||
|
Container Image: rust:1.89-debian-trixie-slim
|
||||||
Rust Version: $(rustc --version)
|
Rust Version: $(rustc --version)
|
||||||
Cargo Version: $(cargo --version)
|
Cargo Version: $(cargo --version)
|
||||||
Git Commit: $(git rev-parse --short HEAD)
|
Git Commit: $(git rev-parse --short HEAD)
|
||||||
|
|
@ -240,6 +218,7 @@ jobs:
|
||||||
=========================
|
=========================
|
||||||
Build Date: $(date)
|
Build Date: $(date)
|
||||||
Debian Version: ${DEBIAN_VERSION}
|
Debian Version: ${DEBIAN_VERSION}
|
||||||
|
Container Image: rust:1.89-debian-trixie-slim
|
||||||
Rust Version: $(rustc --version)
|
Rust Version: $(rustc --version)
|
||||||
Git Commit: $(git rev-parse --short HEAD)
|
Git Commit: $(git rev-parse --short HEAD)
|
||||||
Git Branch: $(git branch --show-current)
|
Git Branch: $(git branch --show-current)
|
||||||
|
|
|
||||||
|
|
@ -14,23 +14,20 @@ jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
# Use Debian 13 (Trixie) since this is a Debian-focused project
|
# Use official Rust image with Debian Trixie base - much better than manual Rust setup
|
||||||
# Note: debian:trixie is the correct tag for Debian 13
|
# Rust 1.89.0 is pre-installed and > 1.84.1 requirement
|
||||||
image: debian:trixie
|
image: rust:1.89-debian-trixie-slim
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code and setup environment
|
- name: Checkout code and setup environment
|
||||||
run: |
|
run: |
|
||||||
apt update -y
|
apt update -y
|
||||||
apt install -y git curl pkg-config libssl-dev libsystemd-dev build-essential
|
apt install -y git curl pkg-config libssl-dev libsystemd-dev build-essential
|
||||||
|
|
||||||
# Install Rust using rustup
|
# Rust 1.89.0 is already installed in rust:1.89-debian-trixie-slim
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
# No need for rustup or toolchain management!
|
||||||
. ~/.cargo/env
|
echo "✅ Using pre-installed Rust from official image:"
|
||||||
|
rustc --version
|
||||||
# Install and use the latest nightly toolchain
|
cargo --version
|
||||||
rustup toolchain install nightly
|
|
||||||
rustup default nightly
|
|
||||||
rustup update
|
|
||||||
|
|
||||||
# Clone repository
|
# Clone repository
|
||||||
git clone https://git.raines.xyz/robojerk/deb-bootupd.git /tmp/deb-bootupd
|
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 "Branch: $(git branch --show-current)"
|
||||||
echo "Commit: $(git rev-parse --short HEAD)"
|
echo "Commit: $(git rev-parse --short HEAD)"
|
||||||
|
|
||||||
# Verify Rust and check version requirements
|
# Verify Rust version meets requirements (need 1.84.1+)
|
||||||
echo "Rust version: $(rustc --version)"
|
|
||||||
echo "Cargo version: $(cargo --version)"
|
|
||||||
|
|
||||||
# Check if Rust version meets requirements (need 1.84.1+)
|
|
||||||
RUST_VERSION=$(rustc --version | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+' | head -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
|
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 "❌ Rust version $RUST_VERSION is too old, need 1.84.1+"
|
||||||
echo "Available toolchains:"
|
exit 1
|
||||||
rustup toolchain list
|
|
||||||
echo "Installing latest nightly..."
|
|
||||||
rustup toolchain install nightly --force
|
|
||||||
rustup default nightly
|
|
||||||
rustup update
|
|
||||||
rustc --version
|
|
||||||
else
|
else
|
||||||
echo "✅ Rust version $RUST_VERSION meets requirement (1.84.1+)"
|
echo "✅ Rust version $RUST_VERSION meets requirement (1.84.1+)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set PATH for subsequent steps
|
# Rust environment is already set up in the container
|
||||||
echo "export PATH=$HOME/.cargo/bin:$PATH" >> $GITHUB_ENV
|
echo "Rust environment ready:"
|
||||||
echo "export CARGO_HOME=$HOME/.cargo" >> $GITHUB_ENV
|
echo "RUSTUP_HOME: $RUSTUP_HOME"
|
||||||
|
echo "CARGO_HOME: $CARGO_HOME"
|
||||||
|
echo "PATH includes: $PATH"
|
||||||
|
|
||||||
- name: Build project
|
- name: Build project
|
||||||
run: |
|
run: |
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue