-
Notifications
You must be signed in to change notification settings - Fork 289
143 lines (136 loc) · 6.08 KB
/
build.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: Build CI
on: [push, pull_request]
jobs:
clippy:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust-toolchain: [nightly, nightly-2024-05-02]
env:
RUSTUP_TOOLCHAIN: ${{ matrix.rust-toolchain }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust-toolchain }}
components: rust-src, clippy, rustfmt
targets: x86_64-unknown-none, riscv64gc-unknown-none-elf, aarch64-unknown-none, aarch64-unknown-none-softfloat
- name: Check rust version
run: rustc --version --verbose
- name: Clippy for the default target
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make clippy
- name: Clippy for x86_64
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make clippy ARCH=x86_64
- name: Clippy for riscv64
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make clippy ARCH=riscv64
- name: Clippy for aarch64
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make clippy ARCH=aarch64
- name: Check code format
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: cargo fmt --all -- --check
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
arch: [x86_64, riscv64, aarch64]
rust-toolchain: [nightly, nightly-2024-05-02]
env:
RUSTUP_TOOLCHAIN: ${{ matrix.rust-toolchain }}
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
- name: Build helloworld
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make ARCH=${{ matrix.arch }} A=examples/helloworld
- name: Build httpclient
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make ARCH=${{ matrix.arch }} A=examples/httpclient
- name: Build httpserver
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make ARCH=${{ matrix.arch }} A=examples/httpserver
- name: Build shell
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make ARCH=${{ matrix.arch }} A=examples/shell
- uses: ./.github/workflows/actions/setup-musl
with:
arch: ${{ matrix.arch }}
- name: Build helloworld-c
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make ARCH=${{ matrix.arch }} A=examples/helloworld-c
- name: Build httpclient-c
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make ARCH=${{ matrix.arch }} A=examples/httpclient-c
- name: Build httpserver-c
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make ARCH=${{ matrix.arch }} A=examples/httpserver-c
build-for-other-platforms:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
rust-toolchain: [nightly, nightly-2024-05-02]
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
- name: Build helloworld for x86_64-pc-oslab
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make PLATFORM=x86_64-pc-oslab A=examples/helloworld
- name: Build httpclient for x86_64-pc-oslab
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make PLATFORM=x86_64-pc-oslab A=examples/httpclient FEATURES=driver-ixgbe
- name: Build httpserver for x86_64-pc-oslab
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make PLATFORM=x86_64-pc-oslab A=examples/httpserver FEATURES=driver-ixgbe
- name: Build shell for x86_64-pc-oslab
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make PLATFORM=x86_64-pc-oslab A=examples/shell
- name: Build helloworld for x86_64-pc-oslab
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make PLATFORM=x86_64-pc-oslab A=examples/helloworld
- name: Build httpclient for x86_64-pc-oslab
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make PLATFORM=x86_64-pc-oslab A=examples/httpclient FEATURES=driver-ixgbe
- name: Build httpserver for x86_64-pc-oslab
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make PLATFORM=x86_64-pc-oslab A=examples/httpserver FEATURES=driver-ixgbe
- name: Build shell for x86_64-pc-oslab
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make PLATFORM=x86_64-pc-oslab A=examples/shell
- name: Build helloworld for aarch64-raspi4
run: make PLATFORM=aarch64-raspi4 A=examples/helloworld
- name: Build shell for aarch64-raspi4
run: make PLATFORM=aarch64-raspi4 A=examples/shell FEATURES=driver-bcm2835-sdhci
- name: Build helloworld for aarch64-bsta1000b
run: make PLATFORM=aarch64-bsta1000b A=examples/helloworld
- uses: ./.github/workflows/actions/setup-musl
with:
arch: x86_64
- name: Build helloworld-c for x86_64-pc-oslab
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make PLATFORM=x86_64-pc-oslab A=examples/helloworld-c
- name: Build httpclient-c for x86_64-pc-oslab
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make PLATFORM=x86_64-pc-oslab A=examples/httpclient-c
- name: Build httpserver-c for x86_64-pc-oslab
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make PLATFORM=x86_64-pc-oslab A=examples/httpserver-c