diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index ab4d43f..28271aa 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -27,11 +27,20 @@ jobs: run: | echo "Setting up Debian environment for building..." - # Add Debian repositories - echo "Adding Debian unstable repositories..." - echo "deb http://deb.debian.org/debian unstable main" | sudo tee /etc/apt/sources.list.d/debian-unstable.list - echo "deb-src http://deb.debian.org/debian unstable main" | sudo tee -a /etc/apt/sources.list.d/debian-unstable.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 unstable main" | sudo tee /etc/apt/sources.list.d/debian-unstable.list + echo "deb-src http://192.168.1.101:3142/ftp.us.debian.org/debian unstable main" | sudo tee -a /etc/apt/sources.list.d/debian-unstable.list + else + echo "⚠️ apt-cacher-ng not available, using standard Debian mirrors..." + echo "deb http://deb.debian.org/debian unstable main" | sudo tee /etc/apt/sources.list.d/debian-unstable.list + echo "deb-src http://deb.debian.org/debian unstable main" | sudo tee -a /etc/apt/sources.list.d/debian-unstable.list + fi + # Add Debian keyring sudo apt update sudo apt install -y debian-archive-keyring