Skip to content

Commit e5ab409

Browse files
authored
Merge pull request #23 from YdrMaster/dev
rustsbi-qemu: rearrangements and refactors
2 parents 96704cf + 4158ad1 commit e5ab409

36 files changed

+2021
-2877
lines changed

.cargo/config.toml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
[alias]
2-
xtask = "run --package xtask --"
2+
xtask = "run --package xtask --release --"
33
make = "xtask make"
4-
qemu = "xtask qemu"
54
asm = "xtask asm"
6-
size = "xtask size"
7-
debug = "xtask debug"
8-
gdb = "xtask gdb"
5+
qemu = "xtask qemu"

.github/workflows/workflow.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
env:
8+
qemu_version: 7.0.0
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-20.04
13+
steps:
14+
- uses: actions/checkout@v3
15+
- uses: actions-rs/toolchain@v1
16+
with:
17+
profile: minimal
18+
toolchain: nightly
19+
components: rustfmt, clippy
20+
target: riscv64imac-unknown-none-elf
21+
- name: Check format
22+
uses: actions-rs/cargo@v1
23+
with:
24+
command: fmt
25+
args: --all -- --check
26+
- name: Clippy
27+
uses: actions-rs/cargo@v1
28+
with:
29+
command: clippy
30+
31+
test:
32+
runs-on: ubuntu-20.04
33+
steps:
34+
- uses: actions/checkout@v3
35+
- uses: actions-rs/toolchain@v1
36+
with:
37+
profile: minimal
38+
toolchain: nightly
39+
components: llvm-tools-preview
40+
target: riscv64imac-unknown-none-elf
41+
42+
- name: Cache QEMU
43+
id: cache-qemu
44+
uses: actions/cache@v3
45+
with:
46+
path: qemu-${{ env.qemu_version }}
47+
key: qemu-${{ env.qemu_version }}
48+
49+
- name: Install ninja-build
50+
run: sudo apt-get update && sudo apt-get install -y ninja-build
51+
52+
- name: Download and Compile QEMU
53+
if: steps.cache-qemu.outputs.cache-hit != 'true'
54+
run: |
55+
wget https://download.qemu.org/qemu-${{ env.qemu_version }}.tar.xz
56+
tar xf qemu-${{ env.qemu_version }}.tar.xz
57+
cd qemu-${{ env.qemu_version }}
58+
./configure --target-list=riscv64-softmmu
59+
make -j
60+
61+
- name: Install QEMU
62+
run: |
63+
cd qemu-${{ env.qemu_version }} && sudo make install
64+
qemu-system-riscv64 --version
65+
66+
- name: Test
67+
uses: actions-rs/cargo@v1
68+
with:
69+
command: test

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1+
**/.*/*
2+
!/.github/*
3+
!/.cargo/*
4+
!/.vscode/settings.json
5+
16
/target
7+
/*.asm

.vscode/settings.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
{
1+
{
22
// Prevent "can't find crate for `test`" error on no_std
33
// Ref: https://github.com/rust-lang/vscode-rust/issues/729
44
// For vscode-rust plugin users:
55
"rust.target": "riscv64imac-unknown-none-elf",
66
"rust.all_targets": false,
77
// For Rust Analyzer plugin users:
88
"rust-analyzer.cargo.target": "riscv64imac-unknown-none-elf",
9-
"rust-analyzer.checkOnSave.allTargets": false
9+
"rust-analyzer.checkOnSave.enable": false,
10+
// Other settings
11+
// For clap
12+
"rust-analyzer.procMacro.attributes.enable": true,
1013
}

0 commit comments

Comments
 (0)