Skip to content

Commit 480deaa

Browse files
committed
CI: Test Firecracker on ARM
1 parent c236f0e commit 480deaa

File tree

1 file changed

+68
-1
lines changed

1 file changed

+68
-1
lines changed

.github/workflows/build.yml

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ env:
1515
permissions: {}
1616

1717
jobs:
18-
test:
18+
test-amd64:
1919
name: Run examples on both architectures
2020
runs-on: ubuntu-latest
2121
steps:
@@ -112,6 +112,73 @@ jobs:
112112
sudo setfacl -m u:${USER}:rw /dev/kvm
113113
opam exec -- dune build @test-threader
114114
115+
test-arm64:
116+
name: Run examples with Firecracker on ARM
117+
runs-on: ubuntu-24.04-arm
118+
steps:
119+
- name: Checkout code
120+
uses: actions/checkout@v4
121+
- name: Install OCaml compiler
122+
uses: ocaml/setup-ocaml@v3
123+
with:
124+
ocaml-compiler: 5.3.0
125+
# We need to pin our packages with their real version numbers, to
126+
# satisfy the dependency bounds of the other packages
127+
opam-pin: false
128+
- name: Pin packages
129+
run: |
130+
opam pin add -yn "https://github.com/mirage/unikraft.git#$UKVER+mirage"
131+
opam pin add -yn "https://github.com/mirage/unikraft-lib-musl.git#$UKVER+mirage"
132+
opam pin add -yn ocaml-unikraft.$OCUKVER .
133+
opam pin add -yn ocaml-unikraft-arm64.$OCUKVER .
134+
opam pin add -yn ocaml-unikraft-backend-firecracker.$UKVER .
135+
opam pin add -yn ocaml-unikraft-backend-firecracker-arm64.$UKVER .
136+
opam pin add -yn ocaml-unikraft-backend-firecracker-x86_64.$UKVER .
137+
opam pin add -yn ocaml-unikraft-backend-qemu.$UKVER .
138+
opam pin add -yn ocaml-unikraft-backend-qemu-arm64.$UKVER .
139+
opam pin add -yn ocaml-unikraft-backend-qemu-x86_64.$UKVER .
140+
opam pin add -yn ocaml-unikraft-default-arm64.$OCUKVER .
141+
opam pin add -yn ocaml-unikraft-default-x86_64.$OCUKVER .
142+
opam pin add -yn ocaml-unikraft-option-debug.$UKVER .
143+
opam pin add -yn ocaml-unikraft-toolchain-arm64.$UKVER .
144+
opam pin add -yn ocaml-unikraft-toolchain-x86_64.$UKVER .
145+
opam pin add -yn ocaml-unikraft-x86_64.$OCUKVER .
146+
- name: Install packages
147+
run: |
148+
opam install \
149+
dune \
150+
ocaml-unikraft-arm64 \
151+
ocaml-unikraft-backend-firecracker-arm64 \
152+
ocaml-unikraft \
153+
ocaml-unikraft-default-arm64 \
154+
ocaml-unikraft-backend-firecracker
155+
- name: Show configuration
156+
run: |
157+
opam exec -- ocamlc -config
158+
opam config list
159+
opam list
160+
opam exec -- ocamlfind -toolchain unikraft ocamlc -config
161+
- name: Install Firecracker
162+
run: |
163+
wget -q -O- "https://github.com/firecracker-microvm/firecracker/releases/download/v$FCVER/firecracker-v$FCVER-aarch64.tgz" | tar xvz
164+
mkdir -p "$HOME/.local/bin"
165+
mv "release-v$FCVER-aarch64/firecracker-v$FCVER-aarch64" "$HOME/.local/bin/firecracker"
166+
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
167+
- name: Test examples with Firecracker
168+
run: |
169+
cd examples/all/
170+
export UNIKRAFTBACKEND=firecracker
171+
sudo setfacl -m u:${USER}:rw /dev/kvm
172+
opam exec -- dune build @test-args
173+
sudo setfacl -m u:${USER}:rw /dev/kvm
174+
opam exec -- dune build @test-fail
175+
sudo setfacl -m u:${USER}:rw /dev/kvm
176+
opam exec -- dune build @test-hello
177+
sudo setfacl -m u:${USER}:rw /dev/kvm
178+
opam exec -- dune build @test-sleeper
179+
sudo setfacl -m u:${USER}:rw /dev/kvm
180+
opam exec -- dune build @test-threader
181+
115182
mirage:
116183
name: Build and test a MirageOS network unikernel
117184
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)