Diffinery

codician/diffinerypublic

Open-source, agent-first GitHub and GitHub Actions alternative that runs on your own Cloudflare account: git hosting, pull requests, code review and drop-in GitHub Actions YAML on Workers, Durable Objects, R2 and Containers.

Merge 7e3f12fcf86cb0d7e10108387012390d8eab3ad8 into bc4d1baf43da951271a59361559d2c71c78de642

Diffinery authored 2 parents bc4d1ba7e3f12fcommit b7b33afe39522c530824084eeefe37438e4e2000Browse files
2 files changed+39−0
modifiedapps/diffinery/docs/actions/compatibility.md+1−0View file
@@ -91,6 +91,7 @@
9191 - Jobs run as `root`. `sudo` is installed and needs no password, as on GitHub, so `sudo` in commands keeps working.
9292 - The apt package lists are removed. Run `apt-get update` before `apt-get install`.
9393 - Every job starts in a fresh container. Nothing carries over between jobs except caches and artifacts.
94+- `/dev/kvm` is available, so the Android emulator and other KVM tools run with hardware acceleration. The image has no udev, so leave out the "Enable KVM" udev step that GitHub's Android guides add, and install the emulator's X libraries first. See [Hardware virtualization (KVM)](/docs/actions/runners#hardware-virtualization-kvm).
9495
9596 On self-hosted runners, `runner.os` is always `Linux`, and the setup actions download Linux builds, even on a macOS machine. See [Self-hosted runners](/docs/actions/runners#self-hosted-runners).
9697
modifiedapps/diffinery/docs/actions/runners.md+38−0View file
@@ -66,6 +66,7 @@
6666 | Architecture | `linux/amd64` (`runner.arch` is `X64`) |
6767 | Operating system | Ubuntu 24.04 (`runner.os` is `Linux`) |
6868 | User | `root`. `sudo` is installed and needs no password, so `sudo apt-get install ...` works as on GitHub |
69+| Virtualization | `/dev/kvm` is available, for the Android emulator, QEMU and other KVM tools. See [Hardware virtualization (KVM)](#hardware-virtualization-kvm) |
6970 | Network | Outbound internet access (only HTTP and HTTPS on instances that set [`EGRESS=web`](/docs/reference/limits#egress)); no inbound connections |
7071 | Workspace | `/workspace/<repository name>` (`GITHUB_WORKSPACE`) |
7172 | Temp directory | `/workspace/_temp` (`RUNNER_TEMP`) |
@@ -153,6 +154,43 @@
153154
154155 > **Note:** Jobs run as `root`, and `sudo` runs commands without asking for a password, as on GitHub's runners. The image ships without apt package lists, so run `sudo apt-get update` before `sudo apt-get install ...`.
155156
157+### Hardware virtualization (KVM)
158+
159+Hosted runners have `/dev/kvm`, so jobs can start virtual machines with hardware acceleration: the Android emulator, QEMU with `-enable-kvm`, Firecracker and other KVM tools. Jobs run as `root`, so `/dev/kvm` is usable without changing its permissions.
160+
161+For Android emulator tests with `reactivecircus/android-emulator-runner`, two things differ from GitHub's image:
162+
163+- **Leave out the "Enable KVM" step** that writes `/etc/udev/rules.d/99-kvm4all.rules` and runs `udevadm`. The image has no udev, so that step fails with `tee: /etc/udev/rules.d/99-kvm4all.rules: No such file or directory`, and it isn't needed when the job runs as root.
164+- **Install the emulator's libraries** before it starts. GitHub's image has them; this one doesn't, and without them the emulator exits with `error while loading shared libraries: libX11.so.6`.
165+
166+```yaml
167+jobs:
168+ android:
169+ runs-on: ubuntu-latest
170+ steps:
171+ - uses: actions/checkout@v4
172+ - uses: actions/setup-java@v4
173+ with:
174+ distribution: temurin
175+ java-version: 17
176+ - uses: android-actions/setup-android@v3
177+ with:
178+ packages: platform-tools
179+ - name: Emulator libraries
180+ run: |
181+ sudo apt-get update -qq
182+ sudo apt-get install -y -qq --no-install-recommends libx11-6 libx11-xcb1 libxcb1 libpulse0 libgl1 libegl1 libnss3 \
183+ libxcomposite1 libxcursor1 libxdamage1 libxi6 libxtst6 libxrandr2 libxkbfile1 libasound2t64 libdbus-1-3 \
184+ libxkbcommon0 libxkbcommon-x11-0 libxcb-cursor0 libfontconfig1 libfreetype6
185+ - uses: reactivecircus/android-emulator-runner@v2
186+ with:
187+ api-level: 30
188+ arch: x86_64
189+ script: ./gradlew connectedCheck
190+```
191+
192+Measured on 2026-10-26 on a large hosted runner: an Android 11 (API 30, x86_64) emulator booted in 37 seconds, and `emulator -accel-check` reported `KVM (version 12) is installed and usable.` Installing the libraries took about 17 seconds. `packages: platform-tools` keeps `setup-android` from asking for the old `tools` package, which its default list includes and which the current SDK no longer has (`Warning: Failed to find package 'tools'`).
193+
156194 ### Docker on hosted runners
157195
158196 Docker works on hosted runners the same way as on GitHub's: job containers, service containers, Docker container actions, and `docker build`, `docker run` and `docker compose` in `run:` steps. Details: