-
Notifications
You must be signed in to change notification settings - Fork 2
95 lines (76 loc) · 3.08 KB
/
Copy pathrust.yml
File metadata and controls
95 lines (76 loc) · 3.08 KB
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
name: Rust
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:
inputs:
qemu_version:
description: "QEMU version to install"
required: false
default: "9.2.0"
type: string
env:
CARGO_TERM_COLOR: always
QEMU_VERSION: ${{ github.event.inputs.qemu_version || '9.2.0' }}
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt, clippy
toolchain: nightly-x86_64-unknown-linux-gnu
rustflags: ""
- name: Add rust-src to toolchain
run: rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
- name: Add x86_64 target
run: rustup target add x86_64-unknown-none
- uses: Swatinem/rust-cache@v2
with:
workspaces: "kernel -> target"
- name: Run linting checks
run: make check
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y xorriso e2fsprogs build-essential ninja-build pkg-config libglib2.0-dev libpixman-1-dev libslirp-dev
- name: Build and install QEMU
run: |
echo "Building QEMU ${QEMU_VERSION}"
sudo apt-get install -y python3 python3-pip git libcap-ng-dev libattr1-dev libzstd-dev
# Install Python dependencies needed by QEMU
sudo pip3 install tomli sphinx sphinx_rtd_theme
wget https://download.qemu.org/qemu-${QEMU_VERSION}.tar.xz
tar xvf qemu-${QEMU_VERSION}.tar.xz
cd qemu-${QEMU_VERSION}
./configure --target-list=x86_64-softmmu --enable-slirp --enable-curses --enable-tools
make -j$(nproc)
sudo make install
qemu-system-x86_64 --version
- name: Setup toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt, clippy
toolchain: nightly-x86_64-unknown-linux-gnu
rustflags: ""
- name: Add rust-src to toolchain
run: rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
- name: Add x86_64 target
run: rustup target add x86_64-unknown-none
- name: Install limage
run: cargo install --git https://github.com/TAOS-Labs/limage
- uses: Swatinem/rust-cache@v2
with:
workspaces: "kernel -> target"
- name: Create blank drive
run: make blank_drive
- name: Run tests
run: make test