diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 3397bd71..9b29be68 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -23,9 +23,21 @@ jobs: steps: - name: Setup environment run: | - # Use Debian's automatic mirror selection (much simpler and faster) - echo "deb http://httpredir.debian.org/debian trixie main contrib non-free" > /etc/apt/sources.list - echo "deb-src http://httpredir.debian.org/debian trixie main contrib non-free" >> /etc/apt/sources.list + # Try apt-cacher-ng first, fallback to Debian's automatic mirror selection + echo "Checking for apt-cacher-ng availability..." + + # Quick check with timeout to avoid hanging + if timeout 10 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 "deb http://192.168.1.101:3142/ftp.debian.org/debian trixie main contrib non-free" > /etc/apt/sources.list + echo "deb-src http://192.168.1.101:3142/ftp.debian.org/debian trixie main contrib non-free" >> /etc/apt/sources.list + echo "Using apt-cacher-ng proxy for faster builds" + else + echo "⚠️ apt-cacher-ng not available or slow, using Debian's automatic mirror selection..." + echo "deb http://httpredir.debian.org/debian trixie main contrib non-free" > /etc/apt/sources.list + echo "deb-src http://httpredir.debian.org/debian trixie main contrib non-free" >> /etc/apt/sources.list + echo "Using httpredir.debian.org for automatic mirror selection" + fi # APT Performance Optimizations (2-3x faster) echo 'Acquire::Languages "none";' > /etc/apt/apt.conf.d/99translations @@ -204,9 +216,21 @@ jobs: steps: - name: Setup environment run: | - # Use Debian's automatic mirror selection (much simpler and faster) - echo "deb http://httpredir.debian.org/debian trixie main contrib non-free" > /etc/apt/sources.list - echo "deb-src http://httpredir.debian.org/debian trixie main contrib non-free" >> /etc/apt/sources.list + # Try apt-cacher-ng first, fallback to Debian's automatic mirror selection + echo "Checking for apt-cacher-ng availability..." + + # Quick check with timeout to avoid hanging + if timeout 10 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 "deb http://192.168.1.101:3142/ftp.debian.org/debian trixie main contrib non-free" > /etc/apt/sources.list + echo "deb-src http://192.168.1.101:3142/ftp.debian.org/debian trixie main contrib non-free" >> /etc/apt/sources.list + echo "Using apt-cacher-ng proxy for faster builds" + else + echo "⚠️ apt-cacher-ng not available or slow, using Debian's automatic mirror selection..." + echo "deb http://httpredir.debian.org/debian trixie main contrib non-free" > /etc/apt/sources.list + echo "deb-src http://httpredir.debian.org/debian trixie main contrib non-free" >> /etc/apt/sources.list + echo "Using httpredir.debian.org for automatic mirror selection" + fi apt update -y @@ -239,9 +263,21 @@ jobs: steps: - name: Setup environment run: | - # Use Debian's automatic mirror selection (much simpler and faster) - echo "deb http://httpredir.debian.org/debian trixie main contrib non-free" > /etc/apt/sources.list - echo "deb-src http://httpredir.debian.org/debian trixie main contrib non-free" >> /etc/apt/sources.list + # Try apt-cacher-ng first, fallback to Debian's automatic mirror selection + echo "Checking for apt-cacher-ng availability..." + + # Quick check with timeout to avoid hanging + if timeout 10 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 "deb http://192.168.1.101:3142/ftp.debian.org/debian trixie main contrib non-free" > /etc/apt/sources.list + echo "deb-src http://192.168.1.101:3142/ftp.debian.org/debian trixie main contrib non-free" >> /etc/apt/sources.list + echo "Using apt-cacher-ng proxy for faster builds" + else + echo "⚠️ apt-cacher-ng not available or slow, using Debian's automatic mirror selection..." + echo "deb http://httpredir.debian.org/debian trixie main contrib non-free" > /etc/apt/sources.list + echo "deb-src http://httpredir.debian.org/debian trixie main contrib non-free" >> /etc/apt/sources.list + echo "Using httpredir.debian.org for automatic mirror selection" + fi apt update -y @@ -290,9 +326,21 @@ jobs: steps: - name: Setup environment run: | - # Use Debian's automatic mirror selection (much simpler and faster) - echo "deb http://httpredir.debian.org/debian trixie main contrib non-free" > /etc/apt/sources.list - echo "deb-src http://httpredir.debian.org/debian trixie main contrib non-free" >> /etc/apt/sources.list + # Try apt-cacher-ng first, fallback to Debian's automatic mirror selection + echo "Checking for apt-cacher-ng availability..." + + # Quick check with timeout to avoid hanging + if timeout 10 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 "deb http://192.168.1.101:3142/ftp.debian.org/debian trixie main contrib non-free" > /etc/apt/sources.list + echo "deb-src http://192.168.1.101:3142/ftp.debian.org/debian trixie main contrib non-free" >> /etc/apt/sources.list + echo "Using apt-cacher-ng proxy for faster builds" + else + echo "⚠️ apt-cacher-ng not available or slow, using Debian's automatic mirror selection..." + echo "deb http://httpredir.debian.org/debian trixie main contrib non-free" > /etc/apt/sources.list + echo "deb-src http://httpredir.debian.org/debian trixie main contrib non-free" >> /etc/apt/sources.list + echo "Using httpredir.debian.org for automatic mirror selection" + fi apt update -y apt install -y --no-install-recommends git