asterinas/.github/workflows/test_nixos.yml

31 lines
1002 B
YAML

name: Test NixOS distro
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
jobs:
nixos-install-test:
runs-on: ubuntu-latest
container:
image: asterinas/asterinas:0.16.1-20251130
options: --device=/dev/kvm --privileged -v /dev:/dev
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Build NixOS image and run hello-asterinas
run: |
make run NIXOS=1 NIXOS_DISK_SIZE_IN_MB=3072 NIXOS_STAGE_2_INIT=hello-asterinas || true
tail --lines 10 qemu.log | grep -q "^Hello Asterinas!" || (echo "Test NixOS failed" && exit 1)
echo "Test NixOS succeeds!"
- name: Basic nix-env test
run: |
make run NIXOS=1 NIXOS_DISK_SIZE_IN_MB=3072 NIXOS_STAGE_2_INIT="nix-env -iA nixos.hello && hello" || true
tail --lines 10 qemu.log | grep -q "^Hello, world!" || (echo "Test nix-env failed" && exit 1)
make clean
echo "Test nix-env succeeds!"