-
Notifications
You must be signed in to change notification settings - Fork 83
109 lines (105 loc) · 4.08 KB
/
x86.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: x86
on:
pull_request:
push:
branches:
- master
- staging
- trying
env:
CARGO_TERM_COLOR: always
defaults:
run:
shell: bash
jobs:
test:
name: x86 tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout rusty-hermit
uses: actions/checkout@v2
with:
repository: hermitcore/rusty-hermit
submodules: true
- name: Remove libhermit-rs submodule
run: git rm -r libhermit-rs
- name: Checkout libhermit-rs
uses: actions/checkout@v2
with:
path: libhermit-rs
- name: Rustup (apply rust-toolchain.toml)
working-directory: libhermit-rs
run: rustup show
- name: Build minimal kernel
working-directory: libhermit-rs
run: cargo build --no-default-features -Z build-std=core,alloc
- name: Build dev profile
run: cargo build
- name: Unittests on host (ubuntu)
if: ${{ matrix.os == 'ubuntu-latest' }}
working-directory: libhermit-rs
run: cargo test --lib --target x86_64-unknown-linux-gnu
- name: Install QEMU, NASM (ubuntu)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo apt-get update
sudo apt-get install qemu-system-x86 nasm
- name: Install QEMU, NASM (macos)
if: ${{ matrix.os == 'macos-latest' }}
run: |
brew update
brew install qemu nasm
- name: Install QEMU, NASM, GNU make (windows)
if: ${{ matrix.os == 'windows-latest' }}
run: |
choco install qemu nasm make
echo "C:\Program Files\qemu" >> $GITHUB_PATH
echo "C:\Program Files\NASM" >> $GITHUB_PATH
- name: Build loader
run: |
sed -i.old 's/OBJCOPY := $(shell find $(SYSROOT) -name llvm-objcopy)/OBJCOPY := $(shell find $(SYSROOT) -name llvm-objcopy -o -name llvm-objcopy.exe)/g' loader/Makefile
make -C loader release=1
- name: Test dev profile
run: |
qemu-system-x86_64 -display none -smp 1 -m 128M -serial stdio \
-cpu qemu64,apic,fsgsbase,rdtscp,xsave,xsaveopt,fxsr \
-kernel loader/target/x86_64-unknown-hermit-loader/release/rusty-loader \
-initrd target/x86_64-unknown-hermit/debug/rusty_demo
- name: Integration tests (ubuntu)
working-directory: libhermit-rs
if: ${{ matrix.os == 'ubuntu-latest' }}
run: cargo test --tests --no-fail-fast -- --bootloader_path=../loader/target/x86_64-unknown-hermit-loader/release/rusty-loader
continue-on-error: true
- name: Build release profile
run: cargo build --release
- name: Test release profile
run: |
qemu-system-x86_64 -display none -smp 1 -m 128M -serial stdio \
-cpu qemu64,apic,fsgsbase,rdtscp,xsave,xsaveopt,fxsr \
-kernel loader/target/x86_64-unknown-hermit-loader/release/rusty-loader \
-initrd target/x86_64-unknown-hermit/release/rusty_demo
- name: Build minimal profile
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
cargo clean
cargo build --no-default-features --release -p hello_world
- name: Test minimal profile
id: minimal
if: ${{ matrix.os == 'ubuntu-latest' }}
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 loader/target/x86_64-unknown-hermit-loader/release/rusty-loader \
-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