Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/library-php8.2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,65 @@ jobs:
with:
name: index.unikraft.io/unikraft.org/php:8.2
push: true

run-remote:
name: Test php:8.2 (Remote OCI)
needs: [build, push]
runs-on: ubuntu-latest
steps:
- name: Login to OCI registry
uses: docker/login-action@v3
with:
registry: index.unikraft.io
username: ${{ secrets.REG_USERNAME }}
password: ${{ secrets.REG_TOKEN }}

- name: Pull, run, validate and cleanup unikernel
run: |
set -euo pipefail
echo "Pull and start php:8.2 unikernel"
IMAGE=index.unikraft.io/unikraft.org/php:8.2
docker pull "$IMAGE"
CONTAINER_ID=$(docker run --rm -d "$IMAGE")
echo "Wait and validate container startup"
sleep 5
if ! docker ps --filter "id=$CONTAINER_ID" --format '{{.ID}}' | grep -q .; then
echo "ERROR: php:8.2 unikernel is not running" >&2
docker logs "$CONTAINER_ID" >&2 || true
docker stop "$CONTAINER_ID" || true
exit 1
fi
echo "php:8.2 unikernel started successfully"
echo "Cleanup container"
docker stop "$CONTAINER_ID" || true

run-local:
name: Test php:8.2 (Local build)
needs: [build]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install kraft CLI
run: |
echo "deb [trusted=yes] https://deb.pkg.kraftkit.sh/ /" | sudo tee /etc/apt/sources.list.d/kraftkit.list
sudo apt-get update
sudo apt-get install -y kraftkit
- name: Build, run and validate unikernel
run: |
set -euo pipefail
sudo chmod 666 /dev/kvm
cd library/php/8.2
echo "Build php:8.2 unikernel"
kraft build --no-cache --no-update --plat qemu --arch x86_64

echo "Run php:8.2 unikernel"
kraft run --rm -M 256M --plat qemu --arch x86_64 . &
PID=$!
sleep 5

echo "php:8.2 unikernel started successfully locally"

echo "Cleanup php:8.2 unikernel"
sudo kill "$PID" || true