diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4eda787b73..769879c7aa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -142,105 +142,39 @@ jobs: - name: Install virtiofsd run: cargo install virtiofsd - name: Test dev profile - run: | - mkdir -p foo - virtiofsd --socket-path=./vhostqemu --shared-dir ./foo --announce-submounts --sandbox none --seccomp none --inode-file-handles=never & - qemu-system-x86_64 -display none -smp 1 -m 1G -serial stdio \ - -cpu qemu64,apic,fsgsbase,rdtscp,xsave,xsaveopt,fxsr \ - -device isa-debug-exit,iobase=0xf4,iosize=0x04 \ - -kernel rusty-loader-x86_64 \ - -chardev socket,id=char0,path=./vhostqemu \ - -device vhost-user-fs-pci,queue-size=1024,chardev=char0,tag=root \ - -object memory-backend-file,id=mem,size=1G,mem-path=/dev/shm,share=on -numa node,memdev=mem \ - -initrd target/x86_64-unknown-hermit/debug/rusty_demo + run: cargo xtask qemu --arch x86_64 --package rusty_demo --virtiofsd + working-directory: ./kernel - name: Build release profile run: cargo build -Zbuild-std=std,panic_abort --package rusty_demo --target x86_64-unknown-hermit --release --features pci-ids - name: Test release profile - run: | - mkdir -p foo - virtiofsd --socket-path=./vhostqemu --shared-dir ./foo --announce-submounts --sandbox none --seccomp none --inode-file-handles=never & - qemu-system-x86_64 -display none -smp 1 -m 1G -serial stdio \ - -cpu qemu64,apic,fsgsbase,rdtscp,xsave,xsaveopt,fxsr \ - -device isa-debug-exit,iobase=0xf4,iosize=0x04 \ - -kernel rusty-loader-x86_64 \ - -chardev socket,id=char0,path=./vhostqemu \ - -device vhost-user-fs-pci,queue-size=1024,chardev=char0,tag=root \ - -object memory-backend-file,id=mem,size=1G,mem-path=/dev/shm,share=on -numa node,memdev=mem \ - -initrd target/x86_64-unknown-hermit/release/rusty_demo + run: cargo xtask qemu --arch x86_64 --package rusty_demo --virtiofsd --release + working-directory: ./kernel - name: Build httpd with DHCP support (debug, rtl8139) - run: - cargo build -Zbuild-std=std,panic_abort --target x86_64-unknown-hermit --package httpd --features ci,dhcpv4,rtl8139 + run: cargo build -Zbuild-std=std,panic_abort --target x86_64-unknown-hermit --package httpd --features ci,dhcpv4,rtl8139 - name: Test httpd with DHCP support (debug, rtl8139) - run: | - qemu-system-x86_64 -smp 1 -cpu qemu64,apic,fsgsbase,rdtscp,xsave,xsaveopt,fxsr,rdrand \ - -device isa-debug-exit,iobase=0xf4,iosize=0x04 -display none -m 128M -serial stdio \ - -kernel rusty-loader-x86_64 \ - -initrd target/x86_64-unknown-hermit/debug/httpd \ - -netdev user,id=u1,hostfwd=tcp::9975-:9975,net=192.168.76.0/24,dhcpstart=192.168.76.9 \ - -device rtl8139,netdev=u1 & - sleep 5 - curl http://127.0.0.1:9975/help - sleep 1 + run: cargo xtask qemu --arch x86_64 --package httpd --netdev rtl8139 + working-directory: ./kernel - name: Build httpd with DHCP support (debug, virtio-net) - run: - cargo build -Zbuild-std=std,panic_abort --target x86_64-unknown-hermit --package httpd --features ci,dhcpv4 + run: cargo build -Zbuild-std=std,panic_abort --target x86_64-unknown-hermit --package httpd --features ci,dhcpv4 - name: Test httpd with DHCP support (debug, virtio-net) - run: | - qemu-system-x86_64 -smp 1 -cpu qemu64,apic,fsgsbase,rdtscp,xsave,xsaveopt,fxsr,rdrand \ - -device isa-debug-exit,iobase=0xf4,iosize=0x04 -display none -m 512M -serial stdio \ - -kernel rusty-loader-x86_64 \ - -initrd target/x86_64-unknown-hermit/debug/httpd \ - -netdev user,id=u1,hostfwd=tcp::9975-:9975,net=192.168.76.0/24,dhcpstart=192.168.76.9 \ - -device virtio-net-pci,netdev=u1,disable-legacy=on & - sleep 5 - curl http://127.0.0.1:9975/help - sleep 1 + run: cargo xtask qemu --arch x86_64 --package httpd --netdev virtio-net-pci + working-directory: ./kernel - name: Build httpd with DHCP support (release, rtl8139) - run: - cargo build -Zbuild-std=std,panic_abort --target x86_64-unknown-hermit --package httpd --release --features ci,dhcpv4,rtl8139 + run: cargo build -Zbuild-std=std,panic_abort --target x86_64-unknown-hermit --package httpd --release --features ci,dhcpv4,rtl8139 - name: Test httpd with DHCP support (release, rtl8139) - run: | - qemu-system-x86_64 -smp 1 -cpu qemu64,apic,fsgsbase,rdtscp,xsave,xsaveopt,fxsr,rdrand \ - -device isa-debug-exit,iobase=0xf4,iosize=0x04 -display none -m 128M -serial stdio \ - -kernel rusty-loader-x86_64 \ - -initrd target/x86_64-unknown-hermit/release/httpd \ - -netdev user,id=u1,hostfwd=tcp::9975-:9975,net=192.168.76.0/24,dhcpstart=192.168.76.9 \ - -device rtl8139,netdev=u1 & - sleep 5 - curl http://127.0.0.1:9975/help - sleep 1 + run: cargo xtask qemu --arch x86_64 --package httpd --netdev rtl8139 --release + working-directory: ./kernel - name: Build httpd with DHCP support (release, virtio-net) - run: - cargo build -Zbuild-std=std,panic_abort --target x86_64-unknown-hermit --package httpd --release --features ci,dhcpv4 + run: cargo build -Zbuild-std=std,panic_abort --target x86_64-unknown-hermit --package httpd --release --features ci,dhcpv4 - name: Test httpd with DHCP support (release, virtio-net) - run: | - qemu-system-x86_64 -smp 1 -cpu qemu64,apic,fsgsbase,rdtscp,xsave,xsaveopt,fxsr,rdrand \ - -device isa-debug-exit,iobase=0xf4,iosize=0x04 -display none -m 512M -serial stdio \ - -kernel rusty-loader-x86_64 \ - -initrd target/x86_64-unknown-hermit/release/httpd \ - -netdev user,id=u1,hostfwd=tcp::9975-:9975,net=192.168.76.0/24,dhcpstart=192.168.76.9 \ - -device virtio-net-pci,netdev=u1,disable-legacy=on & - sleep 5 - curl http://127.0.0.1:9975/help - sleep 1 + run: cargo xtask qemu --arch x86_64 --package httpd --netdev virtio-net-pci --release + working-directory: ./kernel - name: Build minimal profile run: cargo build -Zbuild-std=std,panic_abort --target x86_64-unknown-hermit --no-default-features --release --package hello_world - name: Test minimal profile id: minimal - run: | - FREQ=`grep 'cpu MHz' /proc/cpuinfo | head -1 | awk -F: '{print $2}' | awk '{printf("%d\n",$1 + 0.5)}'` - echo "FREQ = $FREQ" - qemu-system-x86_64 \ - -M microvm,x-option-roms=off,pit=off,pic=off,rtc=on \ - -global virtio-mmio.force-legacy=on -nodefaults -no-user-config \ - -display none -smp 1 -m 64M -serial stdio \ - -kernel rusty-loader-x86_64 \ - -initrd target/x86_64-unknown-hermit/release/hello_world \ - -cpu qemu64,apic,fsgsbase,rdtscp,xsave,xsaveopt,fxsr \ - -device isa-debug-exit,iobase=0xf4,iosize=0x04 \ - -append "-freq $FREQ" \ - || qemu_status=$? - test $qemu_status -eq 3 + run: cargo xtask qemu --arch x86_64 --package hello_world --microvm --release + working-directory: ./kernel run-aarch64: name: Run Hermit for Rust (aarch64) @@ -271,48 +205,24 @@ jobs: - name: Build dev profile run: cargo build -Zbuild-std=std,panic_abort --target aarch64-unknown-hermit --package rusty_demo --features pci-ids - name: Test dev kernel - run: | - qemu-system-aarch64 -semihosting \ - -kernel rusty-loader-aarch64 -machine virt,gic-version=3 \ - -m 512M -cpu cortex-a72 -smp 1 -display none -serial stdio \ - -device guest-loader,addr=0x48000000,initrd=target/aarch64-unknown-hermit/debug/rusty_demo + run: cargo xtask qemu --arch aarch64 --package rusty_demo + working-directory: ./kernel - name: Build release profile run: cargo build -Zbuild-std=std,panic_abort --target aarch64-unknown-hermit --package rusty_demo --release --features pci-ids - name: Test release kernel - run: | - qemu-system-aarch64 -semihosting \ - -kernel rusty-loader-aarch64 -machine virt,gic-version=3 \ - -m 512M -cpu cortex-a72 -smp 1 -display none -serial stdio \ - -device guest-loader,addr=0x48000000,initrd=target/aarch64-unknown-hermit/release/rusty_demo + run: cargo xtask qemu --arch aarch64 --package rusty_demo --release + working-directory: ./kernel - name: Build httpd with DHCP support (debug) - run: - cargo build -Zbuild-std=std,panic_abort --target aarch64-unknown-hermit --package httpd --features ci,dhcpv4 + run: cargo build -Zbuild-std=std,panic_abort --target aarch64-unknown-hermit --package httpd --features ci,dhcpv4 - name: Test httpd with DHCP support (debug, virtio-net) # FIXME: Make test less flaky and remove continue-on-error continue-on-error: true - run: | - qemu-system-aarch64 -semihosting \ - -kernel rusty-loader-aarch64 -machine virt,gic-version=3 \ - -m 512M -cpu cortex-a72 -smp 1 -display none -serial stdio \ - -device guest-loader,addr=0x48000000,initrd=target/aarch64-unknown-hermit/debug/httpd \ - -netdev user,id=u1,hostfwd=tcp::9975-:9975,net=192.168.76.0/24,dhcpstart=192.168.76.9 \ - -device virtio-net-pci,netdev=u1,disable-legacy=on & - sleep 5 - curl http://127.0.0.1:9975/help - sleep 1 + run: cargo xtask qemu --arch aarch64 --package httpd --netdev virtio-net-pci + working-directory: ./kernel - name: Build httpd with DHCP support (release) - run: - cargo build -Zbuild-std=std,panic_abort --target aarch64-unknown-hermit --package httpd --release --features ci,dhcpv4 + run: cargo build -Zbuild-std=std,panic_abort --target aarch64-unknown-hermit --package httpd --release --features ci,dhcpv4 - name: Test httpd with DHCP support (release, virtio-net) # FIXME: Make test less flaky and remove continue-on-error continue-on-error: true - run: | - qemu-system-aarch64 -semihosting \ - -kernel rusty-loader-aarch64 -machine virt,gic-version=3 \ - -m 512M -cpu cortex-a72 -smp 1 -display none -serial stdio \ - -device guest-loader,addr=0x48000000,initrd=target/aarch64-unknown-hermit/release/httpd \ - -netdev user,id=u1,hostfwd=tcp::9975-:9975,net=192.168.76.0/24,dhcpstart=192.168.76.9 \ - -device virtio-net-pci,netdev=u1,disable-legacy=on & - sleep 5 - curl http://127.0.0.1:9975/help - sleep 1 + run: cargo xtask qemu --arch aarch64 --package httpd --netdev virtio-net-pci --release + working-directory: ./kernel