diff --git a/.github/workflows/test_asterinas.yml b/.github/workflows/test_asterinas.yml index 1e27bf9a..44112914 100644 --- a/.github/workflows/test_asterinas.yml +++ b/.github/workflows/test_asterinas.yml @@ -24,6 +24,22 @@ jobs: id: check run: make check + compilation: + if: github.event_name == 'push' || github.event_name == 'pull_request' + runs-on: ubuntu-latest + timeout-minutes: 15 + container: asterinas/asterinas:0.9.4 + steps: + - run: echo "Running in asterinas/asterinas:0.9.4" + + - uses: actions/checkout@v4 + + # The compilation test builds the project with all features enabled. + # In contrast, subsequent tests may choose to enable select features. + - name: Compilation + id: compilation + run: make build FEATURES=all + unit-test: if: github.event_name == 'push' || github.event_name == 'pull_request' runs-on: ubuntu-latest @@ -52,9 +68,9 @@ jobs: image: asterinas/asterinas:0.9.4 options: --device=/dev/kvm strategy: - matrix: + matrix: # The ids of each test - test_id: + test_id: - 'boot_test_mb' - 'boot_test_linux_legacy32' - 'syscall_test' diff --git a/Makefile b/Makefile index 569c40e4..577913a6 100644 --- a/Makefile +++ b/Makefile @@ -32,11 +32,12 @@ GDB_PROFILE_INTERVAL ?= 0.1 AUTO_TEST ?= none EXTRA_BLOCKLISTS_DIRS ?= "" SYSCALL_TEST_DIR ?= /tmp +FEATURES ?= # End of auto test features. # Network settings NETDEV ?= user # Possible values are user,tap -VHOST ?= off +VHOST ?= off # End of network settings # ========================= End of Makefile options. ========================== @@ -87,6 +88,10 @@ else CARGO_OSDK_ARGS += --boot-method="$(BOOT_METHOD)" endif +ifdef FEATURES +CARGO_OSDK_ARGS += --features="$(FEATURES)" +endif + # To test the linux-efi-handover64 boot protocol, we need to use Debian's # GRUB release, which is installed in /usr/bin in our Docker image. ifeq ($(BOOT_PROTOCOL), linux-efi-handover64) diff --git a/kernel/Cargo.toml b/kernel/Cargo.toml index da1b37c2..b5eee841 100644 --- a/kernel/Cargo.toml +++ b/kernel/Cargo.toml @@ -70,4 +70,6 @@ version = "1.0" features = ["spin_no_std"] [features] +all = ["cvm_guest"] + cvm_guest = ["dep:tdx-guest", "ostd/cvm_guest"]