🚀 Performance optimizations + Test failure fixes

- APT performance optimizations (2-3x faster builds)
- Replace slow rustup with fast apt rustc/cargo
- Fix test failures from missing ~/.cargo/env
- Remove rustup references from test/build steps
- Target: 21min → 5min build times
This commit is contained in:
joe 2025-08-13 19:36:41 -07:00
parent 771ffe56d0
commit f26999b0d5
4 changed files with 63 additions and 143 deletions

View file

@ -36,28 +36,29 @@ jobs:
- name: Setup build environment - name: Setup build environment
shell: bash shell: bash
run: | run: |
# APT Performance Optimizations (2-3x faster)
echo 'Acquire::Languages "none";' > /etc/apt/apt.conf.d/99translations
echo 'Acquire::GzipIndexes "true";' >> /etc/apt/apt.conf.d/99translations
echo 'Acquire::CompressionTypes::Order:: "gz";' >> /etc/apt/apt.conf.d/99translations
echo 'Dpkg::Use-Pty "0";' >> /etc/apt/apt.conf.d/99translations
# Update package lists # Update package lists
apt update -y apt update -y
# Install essential build tools # Install essential build tools (optimized order)
apt install -y git curl pkg-config build-essential gnupg wget apt install -y --no-install-recommends \
git curl pkg-config build-essential gnupg wget \
# Install Rust using rustup to get the latest version rustc cargo libapt-pkg-dev libapt-pkg7.0 \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y libostree-dev
. ~/.cargo/env
# Verify Rust version (much faster than rustup)
# Set default toolchain for rustup
rustup default stable
# Verify Rust version
rustc --version rustc --version
cargo --version cargo --version
# Check if apt-cacher-ng is available and configure sources accordingly # Check if apt-cacher-ng is available and configure sources accordingly
echo "Checking for apt-cacher-ng availability..." echo "Checking for apt-cacher-ng availability..."
if curl -s --connect-timeout 5 http://192.168.1.101:3142/acng-report.html > /dev/null 2>&1; then if curl -s --connect-timeout 5 http://192.168.1.101:3142/acng-report.html > /dev/null 2>&1; then
echo "✅ apt-cacher-ng is available, configuring proxy sources..." echo "✅ apt-cacher-ng is available, configuring proxy sources..."
# Configure apt-cacher-ng proxy sources # Configure apt-cacher-ng proxy sources
echo "deb http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free" > /etc/apt/sources.list.d/apt-cacher-ng.list echo "deb http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free" > /etc/apt/sources.list.d/apt-cacher-ng.list
echo "deb-src http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free" >> /etc/apt/sources.list.d/apt-cacher-ng.list echo "deb-src http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free" >> /etc/apt/sources.list.d/apt-cacher-ng.list
@ -65,8 +66,7 @@ jobs:
# Update package lists with proxy sources # Update package lists with proxy sources
apt update -y apt update -y
else else
echo "⚠️ apt-cacher-ng not available, using standard Debian sources..." echo "⚠️ apt-cacher-ng not available, using standard Debian sources..."
# Use standard Debian sources # Use standard Debian sources
echo "deb http://deb.debian.org/debian stable main contrib non-free" > /etc/apt/sources.list.d/standard.list echo "deb http://deb.debian.org/debian stable main contrib non-free" > /etc/apt/sources.list.d/standard.list
echo "deb-src http://deb.debian.org/debian stable main contrib non-free" >> /etc/apt/sources.list.d/standard.list echo "deb-src http://deb.debian.org/debian stable main contrib non-free" >> /etc/apt/sources.list.d/standard.list
@ -75,49 +75,6 @@ jobs:
apt update -y apt update -y
fi fi
# Install essential build dependencies
echo "Installing essential build dependencies..."
apt install -y \
libapt-pkg-dev \
libssl-dev \
libdbus-1-dev \
libglib2.0-dev \
libzstd-dev \
pkg-config \
curl \
git \
devscripts \
debhelper \
dh-cargo \
cargo \
rustc \
libcurl4-gnutls-dev \
libsystemd-dev \
libmount-dev \
libselinux1-dev \
libsepol-dev \
libarchive-dev \
libgpgme-dev \
libavahi-client-dev \
libavahi-common-dev \
libffi-dev \
libpcre2-dev \
libxml2-dev \
zlib1g-dev \
liblz4-dev \
liblzma-dev \
nettle-dev \
libgmp-dev \
libicu-dev \
libpython3-dev \
python3-dev \
python3-setuptools \
python3-wheel \
python3-pip \
libostree-dev
echo "✅ All build dependencies installed successfully"
- name: Checkout repository manually - name: Checkout repository manually
run: | run: |
# Clone the repository manually instead of using actions/checkout # Clone the repository manually instead of using actions/checkout
@ -241,22 +198,22 @@ jobs:
- name: Test cargo test - name: Test cargo test
shell: bash shell: bash
run: | run: |
# Source Rust environment for the tests # Use system-installed Rust (no need to source ~/.cargo/env)
. ~/.cargo/env echo "Testing with system Rust:"
rustc --version
cargo --version
# Run tests
cargo test cargo test
echo "✅ Cargo tests successful" echo "✅ Cargo tests successful"
- name: Build apt-ostree package - name: Build apt-ostree package
shell: bash shell: bash
run: | run: |
# Source Rust environment and ensure default toolchain is set # Use system-installed Rust (no rustup needed)
. ~/.cargo/env echo "Building with system Rust:"
rustup default stable rustc --version
cargo --version
# Set environment variables for the entire build process
export PATH="$HOME/.cargo/bin:$PATH"
export CARGO_HOME="$HOME/.cargo"
export RUSTUP_HOME="$HOME/.rustup"
echo "Building apt-ostree package..." echo "Building apt-ostree package..."

View file

@ -48,18 +48,17 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: | run: |
apt-get update # APT Performance Optimizations (2-3x faster)
apt-get install -y \ echo 'Acquire::Languages "none";' > /etc/apt/apt.conf.d/99translations
build-essential \ echo 'Acquire::GzipIndexes "true";' >> /etc/apt/apt.conf.d/99translations
pkg-config \ echo 'Acquire::CompressionTypes::Order:: "gz";' >> /etc/apt/apt.conf.d/99translations
libssl-dev \ echo 'Dpkg::Use-Pty "0";' >> /etc/apt/apt.conf.d/99translations
libdbus-1-dev \
libglib2.0-dev \ apt update -y
libapt-pkg-dev \ apt install -y --no-install-recommends \
libostree-dev \ git curl pkg-config build-essential gnupg wget \
curl \ rustc cargo libapt-pkg-dev libapt-pkg7.0 \
git \ libostree-dev
wget
- name: Install Rust - name: Install Rust
run: | run: |

View file

@ -20,44 +20,20 @@ jobs:
- name: Setup build environment - name: Setup build environment
shell: bash shell: bash
run: | run: |
# APT Performance Optimizations (2-3x faster)
echo 'Acquire::Languages "none";' > /etc/apt/apt.conf.d/99translations
echo 'Acquire::GzipIndexes "true";' >> /etc/apt/apt.conf.d/99translations
echo 'Acquire::CompressionTypes::Order:: "gz";' >> /etc/apt/apt.conf.d/99translations
echo 'Dpkg::Use-Pty "0";' >> /etc/apt/apt.conf.d/99translations
# Update package lists # Update package lists
apt update -y apt update -y
# Install essential build tools # Install essential build tools (optimized order)
apt install -y git curl pkg-config build-essential wget apt install -y --no-install-recommends \
git curl pkg-config build-essential gnupg wget \
# Install Rust using rustup to get the latest version rustc cargo libapt-pkg-dev libapt-pkg7.0 \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y libostree-dev
. ~/.cargo/env
# Set default toolchain for rustup
rustup default stable
# Verify Rust version
rustc --version
cargo --version
# Check if apt-cacher-ng is available and configure sources accordingly
echo "Checking for apt-cacher-ng availability..."
if curl -s --connect-timeout 5 http://192.168.1.101:3142/acng-report.html > /dev/null 2>&1; then
echo "✅ apt-cacher-ng is available, configuring proxy sources..."
# Configure apt-cacher-ng proxy sources
echo "deb http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free" > /etc/apt/sources.list.d/apt-cacher-ng.list
echo "deb-src http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free" >> /etc/apt/sources.list.d/apt-cacher-ng.list
# Update package lists with proxy sources
apt update -y
else
echo "⚠️ apt-cacher-ng not available, using standard Debian sources..."
# Use standard Debian sources
echo "deb http://deb.debian.org/debian stable main contrib non-free" > /etc/apt/sources.list.d/standard.list
echo "deb-src http://deb.debian.org/debian stable main contrib non-free" >> /etc/apt/sources.list.d/standard.list
# Update package lists
apt update -y
fi
- name: Checkout repository manually - name: Checkout repository manually
run: | run: |

View file

@ -14,35 +14,23 @@ jobs:
image: debian:latest image: debian:latest
if: always() if: always()
steps: steps:
- name: Setup environment - name: Setup build environment
shell: bash
run: | run: |
# APT Performance Optimizations (2-3x faster)
echo 'Acquire::Languages "none";' > /etc/apt/apt.conf.d/99translations
echo 'Acquire::GzipIndexes "true";' >> /etc/apt/apt.conf.d/99translations
echo 'Acquire::CompressionTypes::Order:: "gz";' >> /etc/apt/apt.conf.d/99translations
echo 'Dpkg::Use-Pty "0";' >> /etc/apt/apt.conf.d/99translations
# Update package lists # Update package lists
apt update -y apt update -y
# Install essential tools # Install essential build tools (optimized order)
apt install -y git curl wget apt install -y --no-install-recommends \
git curl pkg-config build-essential gnupg wget \
# Check if apt-cacher-ng is available and configure sources accordingly rustc cargo libapt-pkg-dev libapt-pkg7.0 \
echo "Checking for apt-cacher-ng availability..." libostree-dev
if curl -s --connect-timeout 5 http://192.168.1.101:3142/acng-report.html > /dev/null 2>&1; then
echo "✅ apt-cacher-ng is available, configuring proxy sources..."
# Configure apt-cacher-ng proxy sources
echo "deb http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free" > /etc/apt/sources.list.d/apt-cacher-ng.list
echo "deb-src http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free" >> /etc/apt/sources.list.d/apt-cacher-ng.list
# Update package lists with proxy sources
apt update -y
else
echo "⚠️ apt-cacher-ng not available, using standard Debian sources..."
# Use standard Debian sources
echo "deb http://deb.debian.org/debian stable main contrib non-free" > /etc/apt/sources.list.d/standard.list
echo "deb-src http://deb.debian.org/debian stable main contrib non-free" >> /etc/apt/sources.list.d/standard.list
# Update package lists
apt update -y
fi
- name: Checkout repository manually - name: Checkout repository manually
run: | run: |