name: Check Buildah Build (Safe) on: [push, workflow_dispatch] jobs: buildah-build: runs-on: macos-m1 steps: - name: Install Dependencies run: | if [ -f /etc/alpine-release ]; then # Install buildah, fuse-overlayfs, and netavark (required for networking) apk add --no-cache nodejs git buildah fuse-overlayfs netavark fi - name: Checkout uses: actions/checkout@v4 - name: Build with Buildah run: | echo "FROM alpine" > Dockerfile echo "RUN echo 'Buildah build successful'" >> Dockerfile # Buildah needs some storage configuration tweaks for running inside a container # We use the 'vfs' driver which is slow but works reliably inside containers without special privileges # We use '--isolation=chroot' to avoid cgroup permission issues inside the runner container buildah build --storage-driver=vfs --isolation=chroot -t test-image-arm64 . - name: Build for AMD64 (Cross-Platform Check) run: | echo "FROM alpine" > Dockerfile.amd64 echo "RUN echo 'AMD64 Build successful'" >> Dockerfile.amd64 # Attempt to build for linux/amd64 # This requires QEMU to be configured on the host or installed in the runner buildah build \ --storage-driver=vfs \ --isolation=chroot \ --platform linux/amd64 \ -f Dockerfile.amd64 \ -t test-image-amd64 .