Skip to content

Commit

Permalink
ci: incorporate the pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
cagatay-y committed Oct 6, 2023
1 parent 45cc1b2 commit 579056e
Showing 1 changed file with 43 additions and 33 deletions.
76 changes: 43 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,40 +106,41 @@ jobs:
working-directory: kernel
strategy:
matrix:
arch: ["x86_64", "aarch64"]
release-profile: ["--dev", "--release"]
demo: ["rusty_demo", "httpd", "httpd-rtl8139", "testudp", "microvm"]
arch: [x86_64, aarch64]
profile: [dev, release]
package: [rusty_demo, httpd, testudp, hello_world]
netdev: [virtio-net-pci, rtl8139]
include:
- arch: "x86_64"
packages: "qemu-system-x86 libcap-ng-dev libseccomp-dev socat"
- arch: "aarch64"
packages: "qemu-system-aarch64"
- arch: x86_64
packages: qemu-system-x86 libcap-ng-dev libseccomp-dev socat
- arch: aarch64
packages: qemu-system-aarch64

# Demos that do not share a name with the corresponding package
- demo: "httpd-rtl8139"
package: "httpd"
- demo: "microvm"
package: "hello_world"

- arch: "x86_64"
demo: "rusty_demo"
flags: "--features pci-ids --virtiofsd"
- arch: "aarch64"
demo: "rusty_demo"
flags: "--features pci-ids"
- demo: "httpd"
flags: "--features ci,dhcpv4 --netdev virtio-net-pci"
- demo: "httpd-rtl8139"
flags: "--features ci,dhcpv4,rtl8139 --netdev rtl8139"
- demo: "microvm"
flags: "--no-default-features --microvm"
- demo: "testudp"
flags: "--features udp,dhcpv4 --netdev virtio-net-pci"
- arch: x86_64
package: rusty_demo
flags: --features pci-ids --virtiofsd
- arch: aarch64
package: rusty_demo
flags: --features pci-ids
- package: httpd
flags: --features ci,dhcpv4
- package: testudp
flags: --features udp,dhcpv4
- package: hello_world
flags: --no-default-features --microvm
exclude:
- arch: "aarch64"
demo: "httpd-rtl8139"
- arch: "aarch64"
demo: "microvm"
# rtl8139 does not build on aarch64
- arch: aarch64
netdev: rtl8139
# microvm (Firecracker) test does not run on aarch64
- package: hello_world
arch: aarch64
# The rusty_demo and microvm tests ignore the netdev, so we exclude all but one netdev to prevent redundant jobs.
# We choose rtl8139 to not build an unnecessary feature into the build
- package: hello_world
netdev: rtl8139
- package: rusty_demo
netdev: rtl8139

steps:
- name: Checkout hermit-rs
Expand Down Expand Up @@ -176,8 +177,17 @@ jobs:
if: ${{ matrix.arch == 'x86_64' && matrix.demo == 'rusty_demo' }}
run: cargo install virtiofsd
- name: Run VM
# The package name is the same as the demo name if not explicitly specified
run: cargo xtask ci qemu --arch ${{ matrix.arch }} --package ${{ matrix.package || matrix.demo }} ${{ matrix.flags }}
# cargo accepts multiple 'features' flags
# The '… && … || …' expression is like a ternary operator
# netdev is only relevant for tests that use network functionality (and are thus built with dhcpv4)
run: >
cargo xtask ci qemu
--arch ${{ matrix.arch }}
--package ${{ matrix.package }}
${{ matrix.flags }}
${{ matrix.netdev == 'rtl8139' && '--features rtl8139' || '' }}
${{ contains(matrix.flags, 'dhcpv4') && format('--netdev {0}', matrix.netdev) || '' }}
--${{ matrix.profile }}
run-x86_64-kvm:
name: Run Hermit for Rust (x86_64 + kvm)
Expand Down

0 comments on commit 579056e

Please sign in to comment.