forked from arceos-org/starry-next
-
Notifications
You must be signed in to change notification settings - Fork 13
81 lines (77 loc) · 2.54 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
73
74
75
76
77
78
79
80
81
name: CI
on: [push, pull_request]
jobs:
clippy:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust-toolchain: [nightly]
targets: [x86_64-unknown-none, riscv64gc-unknown-none-elf, aarch64-unknown-none-softfloat]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust-toolchain }}
components: rust-src, clippy, rustfmt
targets: ${{ matrix.targets }}
- name: Setup ArceOS
run: ./scripts/get_deps.sh
- name: Check rust version
run: rustc --version --verbose
- name: Check code format
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: cargo fmt --all -- --check
- name: Clippy
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: cargo clippy --target ${{ matrix.targets }} --all-features -- -D warnings -A clippy::new_without_default
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
arch: [x86_64, riscv64, aarch64]
rust-toolchain: [nightly]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust-toolchain }}
components: rust-src, llvm-tools
targets: x86_64-unknown-none, riscv64gc-unknown-none-elf, aarch64-unknown-none, aarch64-unknown-none-softfloat
- uses: Swatinem/rust-cache@v2
- run: cargo install cargo-binutils
- run: ./scripts/get_deps.sh
- name: Build for ${{ matrix.arch }}
run: make ARCH=${{ matrix.arch }}
test-musl:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
arch: [x86_64, riscv64, aarch64]
rust-toolchain: [nightly]
env:
qemu-version: 8.2.0
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust-toolchain }}
components: rust-src, llvm-tools
- uses: Swatinem/rust-cache@v2
- run: cargo install cargo-binutils
- run: ./scripts/get_deps.sh
- uses: ./.github/workflows/actions/setup-musl
with:
arch: ${{ matrix.arch }}
- uses: ./.github/workflows/actions/setup-qemu
with:
qemu-version: ${{ env.qemu-version }}
- name: Build rustup target
if: ${{ matrix.arch != 'riscv64' }}
run: rustup target add ${{ matrix.arch }}-unknown-linux-musl
- name: Run tests for musl applications
run: make test ARCH=${{ matrix.arch }}