-
Notifications
You must be signed in to change notification settings - Fork 376
65 lines (58 loc) · 1.98 KB
/
main.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
name: CI
on: [push, pull_request]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2020-06-04
override: true
components: rustfmt, clippy
- name: Check code format
run: cd kernel && cargo fmt -- --check
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
# we will bring back mipsel later
arch: [x86_64, riscv32, riscv64, aarch64, mipsel]
steps:
- uses: actions/checkout@v2
- name: Checkout submodules
run: git submodule update --init --recursive
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2020-06-04
components: rust-src, llvm-tools-preview
- name: Cache QEMU
if: runner.os == 'Linux'
uses: actions/cache@v1
with:
path: qemu-4.2.0
key: ${{ runner.os }}-${{ matrix.arch }}-qemu
- name: Install QEMU
if: runner.os == 'Linux'
run: |
[ ! -d qemu-4.2.0 ] && wget https://download.qemu.org/qemu-4.2.0.tar.xz && tar xJf qemu-4.2.0.tar.xz > /dev/null
cd qemu-4.2.0 && ./configure --target-list=${{ matrix.arch }}-softmmu && sudo make install -j && cd ..
- name: Install QEMU
if: runner.os == 'macOS'
run: brew install qemu
- name: Install dependencies
if: runner.os == 'Linux'
run: sudo apt install -y device-tree-compiler
- name: Install dependencies
if: runner.os == 'macOS'
run: brew install dtc
- name: Download prebuilt user image
run: cd user && make sfsimg ARCH=${{ matrix.arch }} PREBUILT=1 && cd ..
- name: Build kernel
run: cd kernel && make build ARCH=${{ matrix.arch }} && cd ..
- name: Build kernel with hypervisor
if: runner.os == 'Linux' && matrix.arch == 'x86_64'
run: cd kernel && make build ARCH=${{ matrix.arch }} HYPERVISOR=on && cd ..