name: Test bootc Documentation on: push: branches: [ main ] pull_request: branches: [ main ] jobs: test-base-image: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set up Podman run: | sudo apt-get update sudo apt-get install -y podman podman --version - name: Build base image run: | cd building podman build -f base-images-wo-bootc.md -t debian-bootc-test:latest . # Extract Containerfile from markdown grep -A 1000 "```dockerfile" base-images-wo-bootc.md | grep -B 1000 "```" | sed '1d;$d' > Containerfile.test podman build -f Containerfile.test -t debian-bootc-test:latest . - name: Test image validation run: | # Test label validation podman inspect debian-bootc-test:latest | grep -q '"containers.bootc": "1"' || exit 1 podman inspect debian-bootc-test:latest | grep -q '"ostree.bootable": "1"' || exit 1 echo "✅ Label validation passed" # Test filesystem validation MOUNTPOINT=$(podman image mount debian-bootc-test:latest) if [ -n "$MOUNTPOINT" ]; then # Check systemd as init if [ -L "$MOUNTPOINT/sbin/init" ] && [ "$(readlink "$MOUNTPOINT/sbin/init")" = "/lib/systemd/systemd" ]; then echo "✅ systemd is properly set as init" else echo "❌ systemd is not set as init" exit 1 fi # Check essential binaries for binary in /lib/systemd/systemd /usr/bin/systemctl /sbin/init; do if [ -f "$MOUNTPOINT$binary" ]; then echo "✅ $binary exists" else echo "❌ $binary missing" exit 1 fi done podman image umount debian-bootc-test:latest else echo "⚠️ Could not mount image, skipping filesystem validation" fi echo "✅ All validations passed" - name: Test nginx layer run: | # Create a simple nginx test cat > nginx-test.dockerfile << 'EOF' FROM debian-bootc-test:latest RUN apt update && apt install -y nginx && apt clean RUN systemctl enable nginx.service LABEL containers.bootc 1 LABEL ostree.bootable 1 CMD ["/lib/systemd/systemd"] EOF podman build -f nginx-test.dockerfile -t debian-bootc-nginx-test:latest . # Test nginx configuration podman run --rm debian-bootc-nginx-test:latest nginx -t || echo "⚠️ nginx config test failed (expected in container)" echo "✅ nginx layer test completed" - name: Cleanup if: always() run: | podman rmi debian-bootc-test:latest debian-bootc-nginx-test:latest || true rm -f nginx-test.dockerfile Containerfile.test || true test-documentation: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Check markdown syntax run: | # Install markdown lint if available if command -v markdownlint >/dev/null 2>&1; then find . -name "*.md" -not -path "./.git/*" | xargs markdownlint else echo "markdownlint not available, skipping markdown syntax check" fi - name: Check for broken links run: | # Simple check for obvious broken links grep -r "https://" . --include="*.md" | grep -v "github.com" | grep -v "debian.org" | grep -v "apache.org" || echo "No external links found" - name: Validate documentation structure run: | # Check that all referenced files exist for file in README.md COMPATIBILITY.md installation.md; do if [ -f "$file" ]; then echo "✅ $file exists" else echo "❌ $file missing" exit 1 fi done # Check that building directory has required files for file in building/base-images.md building/base-images-wo-bootc.md; do if [ -f "$file" ]; then echo "✅ $file exists" else echo "❌ $file missing" exit 1 fi done echo "✅ Documentation structure validation passed"