asterinas/.github/workflows/test_nixos_minimal.yml

43 lines
1.5 KiB
YAML

# A basic CI test for NixOS.
#
# This workflow is intended to include the most basic test for AsterNixOS.
# It requires only a minimal amount of disk space
# and thus can be run on standard Github runners _for free_.
name: Test AsterNixOS (minimal)
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
jobs:
minimal-nixos-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
# In the subsequent tests, a relatively large disk (4GB) will be created to install AsterNixOS.
# Standard GitHub runners may encounter "insufficient disk space" errors.
# Therefore, we first execute the following action to free up
# some disk space. The amount of space saved can be referenced in
# https://github.com/endersonmenezes/free-disk-space?tab=readme-ov-file#size-savings,
# currently amounting to approximately 24GB.
- uses: endersonmenezes/free-disk-space@v3
with:
rm_cmd: "rmz"
remove_android: true
remove_dotnet: true
remove_haskell: true
remove_tool_cache: true
- uses: actions/checkout@v4
- name: Run the hello test on AsterNixOS
timeout-minutes: 30
uses: addnab/docker-run-action@v3
with:
image: asterinas/asterinas:0.17.0-20251228
options: --privileged -v /dev:/dev -v ${{ github.workspace }}:/root/asterinas
run: |
make nixos NIXOS_TEST_SUITE=hello NIXOS_DISK_SIZE_IN_MB=6144
make run_nixos NIXOS_TEST_SUITE=hello