apt-ostree/.forgejo/workflows/ci.yml
joe 337805486c Simplify CI workflow for better Forgejo compatibility
- Remove complex matrix strategy that was causing failures
- Simplify to 3 core jobs: build-and-test, security, package
- Remove advanced features that may not be fully supported
- Focus on core functionality that's known to work
- Better error handling and simpler job structure
2025-08-13 16:51:46 -07:00

234 lines
6.9 KiB
YAML

name: Simple CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
# Simple build and test
build-and-test:
name: Build and Test
runs-on: ubuntu-latest
container:
image: debian:latest
steps:
- name: Checkout code
run: |
# Clone the repository manually
git clone https://git.raines.xyz/robojerk/apt-ostree.git /tmp/apt-ostree
cp -r /tmp/apt-ostree/* .
cp -r /tmp/apt-ostree/.* . 2>/dev/null || true
- name: Setup environment
run: |
# Update package lists
apt update -y
# Check if apt-cacher-ng is available
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..."
cat > /etc/apt/sources.list.d/apt-cacher-ng.list << 'EOF'
deb http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free
deb-src http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free
deb http://192.168.1.101:3142/HTTPS///get.docker.com/ubuntu docker main
EOF
apt update -y
else
echo "⚠️ apt-cacher-ng not available, using standard Debian sources..."
cat > /etc/apt/sources.list.d/standard.list << 'EOF'
deb http://deb.debian.org/debian stable main contrib non-free
deb-src http://deb.debian.org/debian stable main contrib non-free
EOF
apt update -y
fi
- 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 \
curl \
git \
wget
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
. ~/.cargo/env
rustup default stable
- name: Build project
run: |
. ~/.cargo/env
cargo build --release
- name: Run tests
run: |
. ~/.cargo/env
cargo test
- name: Create summary
run: |
echo "Build and test completed successfully!"
echo "✅ CI completed! 🎉"
# Security check
security:
name: Security Audit
runs-on: ubuntu-latest
container:
image: debian:latest
steps:
- name: Checkout code
run: |
git clone https://git.raines.xyz/robojerk/apt-ostree.git /tmp/apt-ostree
cp -r /tmp/apt-ostree/* .
cp -r /tmp/apt-ostree/.* . 2>/dev/null || true
- name: Setup environment
run: |
apt update -y
if curl -s --connect-timeout 5 http://192.168.1.101:3142/acng-report.html > /dev/null 2>&1; then
cat > /etc/apt/sources.list.d/apt-cacher-ng.list << 'EOF'
deb http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free
deb-src http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free
EOF
apt update -y
else
cat > /etc/apt/sources.list.d/standard.list << 'EOF'
deb http://deb.debian.org/debian stable main contrib non-free
deb-src http://deb.debian.org/debian stable main contrib non-free
EOF
apt update -y
fi
- name: Install Rust and security tools
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
. ~/.cargo/env
apt-get update
apt-get install -y cargo-audit
- name: Run security audit
run: |
. ~/.cargo/env
cargo audit
- name: Create summary
run: |
echo "Security audit completed successfully!"
echo "✅ Security check completed! 🎉"
# Package build
package:
name: Build Package
runs-on: ubuntu-latest
container:
image: debian:latest
steps:
- name: Checkout code
run: |
git clone https://git.raines.xyz/robojerk/apt-ostree.git /tmp/apt-ostree
cp -r /tmp/apt-ostree/* .
cp -r /tmp/apt-ostree/.* . 2>/dev/null || true
- name: Setup environment
run: |
apt update -y
if curl -s --connect-timeout 5 http://192.168.1.101:3142/acng-report.html > /dev/null 2>&1; then
cat > /etc/apt/sources.list.d/apt-cacher-ng.list << 'EOF'
deb http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free
deb-src http://192.168.1.101:3142/ftp.debian.org/debian stable main contrib non-free
EOF
apt update -y
else
cat > /etc/apt/sources.list.d/standard.list << 'EOF'
deb http://deb.debian.org/debian stable main contrib non-free
deb-src http://deb.debian.org/debian stable main contrib non-free
EOF
apt update -y
fi
- name: Install build dependencies
run: |
apt-get update
apt-get install -y \
build-essential \
devscripts \
debhelper \
dh-cargo \
cargo \
rustc \
pkg-config \
libssl-dev \
libdbus-1-dev \
libglib2.0-dev \
libapt-pkg-dev
- name: Build package
run: |
if [ -f "./build-debian-trixie.sh" ]; then
chmod +x ./build-debian-trixie.sh
./build-debian-trixie.sh
else
echo "Build script not found, attempting manual build..."
dpkg-buildpackage -us -uc -b
fi
- name: Create summary
run: |
echo "Package build completed!"
ls -la ../*.deb 2>/dev/null || echo "No packages found"
echo "✅ Package build completed! 🎉"
# Final status
status:
name: Final Status
needs: [build-and-test, security, package]
runs-on: ubuntu-latest
if: always()
steps:
- name: Check results
run: |
echo "All jobs completed"
echo "Build and Test: ${{ needs.build-and-test.result }}"
echo "Security: ${{ needs.security.result }}"
echo "Package: ${{ needs.package.result }}"
cat > CI_SUMMARY.md << 'EOF'
# APT-OSTree CI Summary
## Build Information
- **Build Date**: $(date '+%Y-%m-%d %H:%M:%S UTC')
- **Build ID**: ${{ forge.run_number }}
- **Commit**: ${{ forge.sha }}
- **Branch**: ${{ forge.ref_name }}
## Job Results
- **Build and Test**: ${{ needs.build-and-test.result }}
- **Security**: ${{ needs.security.result }}
- **Package**: ${{ needs.package.result }}
## Summary
CI completed. Check individual job results above.
EOF
echo "CI summary created: CI_SUMMARY.md"
echo "✅ All CI jobs completed! 🎉"