Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/build.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/usr/bin/expect

set timeout 60
spawn sh boot/qemu -ci

# Boot up
expect "Selection: "
send "4\r"
expect "bootfile: "
send "2\r"
expect "term% "

proc terminate {status} {
# Halt
expect "term% "
send "fshalt\r"
expect "done halting"

# Enter QEMU monitor
send "\x1d" ; # Ctrl+Alt+2
send "close\r"

exit $status
}

# Build sources
send "cd /sys/src\r"
expect "term% "

set timeout [expr 10*60]
send "objtype=386 mk libs cleanlibs\r"
expect {
timeout {
puts stderr "timeout"
exit 1
}
-re "mk: (.+): exit status=(.+)" {
terminate 1
}
"term% "
}

set timeout [expr 2*60*60]
send "mk release\r"
expect {
timeout {
puts stderr "timeout"
exit 1
}
-re "mk: (.+): exit status=(.+)" {
terminate 1
}
"term% "
}

set timeout 60
send "echo XXX:\$status\r"
terminate 0
24 changes: 24 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Build

on:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup qemu
run: |
sudo apt update
sudo apt -y install qemu-kvm expect
- name: Install plan9 binaries from the latest release
run: |
gh release download --pattern=x86.tar.gz
tar zxf x86.tar.gz
rm -f x86.tar.gz
env:
GH_TOKEN: ${{ github.token }}
- name: Run tests
run: |
./boot/mkdirs
./.github/workflows/build.tcl
10 changes: 8 additions & 2 deletions boot/qemu
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -e
cd $(dirname $0)

pxe=pxeboot.raw
display=gtk
vmdisk=false
case "$1" in
-pxenew)
Expand All @@ -13,13 +14,18 @@ case "$1" in
-mini)
pxe=mini.raw
shift
;;
-ci)
display=none
shift
;;
esac

case "$#" in
0)
;;
*)
echo 'usage: boot/qemu [-pxenew]' >&2
echo 'usage: boot/qemu [-pxenew] [-mini] [-ci]' >&2
exit 1
esac

Expand All @@ -30,7 +36,7 @@ u9fs="guestfwd=tcp:10.0.2.1:564-cmd:../sys/src/cmd/unix/u9fs/u9fs -a none -u $US
tftp='tftp=..'
mac=mac=52:54:00:12:34:56

qemu-system-x86_64 -m 1G -smp 1 -serial stdio \
qemu-system-x86_64 -m 1G -smp 1 -serial stdio -display $display \
-drive file=$pxe,format=raw -snapshot \
-device virtio-net-pci,netdev=net0,$mac \
-netdev "user,id=net0,$u9fs,$tftp"
2 changes: 1 addition & 1 deletion cfg/pxe/525400123456
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ sysname=gnot
partition=new
factotumopts=-n
user=glenda
console=0
console=0 b115200 l8 pn s1
mouseport=ps2intellimouse
monitor=vesa
*nomp=1
Expand Down