52 lines
1.8 KiB
YAML
52 lines
1.8 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
|
|
matrix:
|
|
test:
|
|
- name: hello
|
|
disk_size: 6144
|
|
- name: go
|
|
disk_size: 8192
|
|
|
|
name: Test ${{ matrix.test.name }}
|
|
timeout-minutes: 60
|
|
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 ${{ matrix.test.name }} test on AsterNixOS
|
|
uses: addnab/docker-run-action@v3
|
|
with:
|
|
image: asterinas/asterinas:0.17.0-20260114
|
|
options: --privileged -v /dev:/dev -v ${{ github.workspace }}:/root/asterinas
|
|
run: |
|
|
make nixos NIXOS_TEST_SUITE=${{ matrix.test.name }} NIXOS_DISK_SIZE_IN_MB=${{ matrix.test.disk_size }}
|
|
make run_nixos NIXOS_TEST_SUITE=${{ matrix.test.name }}
|