-
Notifications
You must be signed in to change notification settings - Fork 2
72 lines (60 loc) · 2.19 KB
/
ci.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
name: Check, Build and Test
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# ZR233/ostool requires
- name: Install qemu-system
run: sudo apt update && sudo apt install qemu-system -y
- name: Install libudev-dev
run: sudo apt update && sudo apt install libudev-dev -y
- name: Install cargo-binutils
run: cargo install cargo-binutils
- name: Install ostool
run: cargo install ostool
- name: Install toolchain
run: rustup show
- name: Check rust version
run: rustc --version --verbose
- name: Add Target
run: rustup target add aarch64-unknown-none
- name: Check code format
run: cargo fmt --all -- --check
- uses: taiki-e/install-action@cargo-hack
- name: Clippy for workspace
run: cargo clippy -- -D warnings
- name: Clippy for each package & each feature
run: cargo hack clippy --each-feature -- -Dwarnings
- name: Add config
run: |
echo "[compile]" > .project.toml
echo 'target = "aarch64-unknown-none"' >> .project.toml
echo "[compile.cargo]" >> .project.toml
echo 'package = "helloworld"' >> .project.toml
echo 'log_level = "Debug"' >> .project.toml
echo 'rust_flags = "-C link-arg=-Tlink.x -C link-arg=-no-pie -C link-arg=-znostart-stop-gc"' >> .project.toml
echo 'features = []' >> .project.toml
echo "[compile.cargo.env]" >> .project.toml
echo "[qemu]" >> .project.toml
echo 'machine = "virt"' >> .project.toml
echo 'cpu = "cortex-a53"' >> .project.toml
echo 'graphic = false' >> .project.toml
echo 'args = ""' >> .project.toml
- name: Build test
run: ostool build
- name: Test bare-test simple_test
if: ${{ always() }}
working-directory: app/simple_test
run: cargo test --test test1
- name: Test sparreal-macros
if: ${{ always() }}
working-directory: crates/sparreal-macros
run: cargo test
- name: Test page-table-arm
if: ${{ always() }}
working-directory: crates/page-table-arm
run: cargo test --target x86_64-unknown-linux-gnu