🚀 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:
parent
771ffe56d0
commit
f26999b0d5
4 changed files with 63 additions and 143 deletions
|
|
@ -36,20 +36,22 @@ jobs:
|
|||
- name: Setup build environment
|
||||
shell: bash
|
||||
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
|
||||
apt update -y
|
||||
|
||||
# Install essential build tools
|
||||
apt install -y git curl pkg-config build-essential gnupg wget
|
||||
# Install essential build tools (optimized order)
|
||||
apt install -y --no-install-recommends \
|
||||
git curl pkg-config build-essential gnupg wget \
|
||||
rustc cargo libapt-pkg-dev libapt-pkg7.0 \
|
||||
libostree-dev
|
||||
|
||||
# Install Rust using rustup to get the latest version
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||
. ~/.cargo/env
|
||||
|
||||
# Set default toolchain for rustup
|
||||
rustup default stable
|
||||
|
||||
# Verify Rust version
|
||||
# Verify Rust version (much faster than rustup)
|
||||
rustc --version
|
||||
cargo --version
|
||||
|
||||
|
|
@ -57,7 +59,6 @@ jobs:
|
|||
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
|
||||
|
|
@ -65,8 +66,7 @@ jobs:
|
|||
# Update package lists with proxy sources
|
||||
apt update -y
|
||||
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
|
||||
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
|
||||
|
|
@ -75,49 +75,6 @@ jobs:
|
|||
apt update -y
|
||||
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
|
||||
run: |
|
||||
# Clone the repository manually instead of using actions/checkout
|
||||
|
|
@ -241,22 +198,22 @@ jobs:
|
|||
- name: Test cargo test
|
||||
shell: bash
|
||||
run: |
|
||||
# Source Rust environment for the tests
|
||||
. ~/.cargo/env
|
||||
# Use system-installed Rust (no need to source ~/.cargo/env)
|
||||
echo "Testing with system Rust:"
|
||||
rustc --version
|
||||
cargo --version
|
||||
|
||||
# Run tests
|
||||
cargo test
|
||||
echo "✅ Cargo tests successful"
|
||||
|
||||
- name: Build apt-ostree package
|
||||
shell: bash
|
||||
run: |
|
||||
# Source Rust environment and ensure default toolchain is set
|
||||
. ~/.cargo/env
|
||||
rustup default stable
|
||||
|
||||
# Set environment variables for the entire build process
|
||||
export PATH="$HOME/.cargo/bin:$PATH"
|
||||
export CARGO_HOME="$HOME/.cargo"
|
||||
export RUSTUP_HOME="$HOME/.rustup"
|
||||
# Use system-installed Rust (no rustup needed)
|
||||
echo "Building with system Rust:"
|
||||
rustc --version
|
||||
cargo --version
|
||||
|
||||
echo "Building apt-ostree package..."
|
||||
|
||||
|
|
|
|||
|
|
@ -48,18 +48,17 @@ jobs:
|
|||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y \
|
||||
build-essential \
|
||||
pkg-config \
|
||||
libssl-dev \
|
||||
libdbus-1-dev \
|
||||
libglib2.0-dev \
|
||||
libapt-pkg-dev \
|
||||
libostree-dev \
|
||||
curl \
|
||||
git \
|
||||
wget
|
||||
# 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
|
||||
|
||||
apt update -y
|
||||
apt install -y --no-install-recommends \
|
||||
git curl pkg-config build-essential gnupg wget \
|
||||
rustc cargo libapt-pkg-dev libapt-pkg7.0 \
|
||||
libostree-dev
|
||||
|
||||
- name: Install Rust
|
||||
run: |
|
||||
|
|
|
|||
|
|
@ -20,44 +20,20 @@ jobs:
|
|||
- name: Setup build environment
|
||||
shell: bash
|
||||
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
|
||||
apt update -y
|
||||
|
||||
# Install essential build tools
|
||||
apt install -y git curl pkg-config build-essential wget
|
||||
|
||||
# Install Rust using rustup to get the latest version
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||
. ~/.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
|
||||
# Install essential build tools (optimized order)
|
||||
apt install -y --no-install-recommends \
|
||||
git curl pkg-config build-essential gnupg wget \
|
||||
rustc cargo libapt-pkg-dev libapt-pkg7.0 \
|
||||
libostree-dev
|
||||
|
||||
- name: Checkout repository manually
|
||||
run: |
|
||||
|
|
|
|||
|
|
@ -14,35 +14,23 @@ jobs:
|
|||
image: debian:latest
|
||||
if: always()
|
||||
steps:
|
||||
- name: Setup environment
|
||||
- name: Setup build environment
|
||||
shell: bash
|
||||
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
|
||||
apt update -y
|
||||
|
||||
# Install essential tools
|
||||
apt install -y git curl wget
|
||||
|
||||
# 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
|
||||
# Install essential build tools (optimized order)
|
||||
apt install -y --no-install-recommends \
|
||||
git curl pkg-config build-essential gnupg wget \
|
||||
rustc cargo libapt-pkg-dev libapt-pkg7.0 \
|
||||
libostree-dev
|
||||
|
||||
- name: Checkout repository manually
|
||||
run: |
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue