-
Notifications
You must be signed in to change notification settings - Fork 1
119 lines (113 loc) · 6.35 KB
/
Copy pathci.yml
File metadata and controls
119 lines (113 loc) · 6.35 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: CI
on:
push:
branches: [main]
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
libs:
name: Libraries
runs-on: ubuntu-latest
defaults:
run:
working-directory: lib
steps:
- uses: actions/checkout@v6
- run: rustup toolchain install stable --profile minimal --component rustfmt,clippy
- run: cargo fmt --all -- --check
- run: cargo clippy --all-targets -- -D warnings
- run: cargo build
- run: cargo test
- run: cargo doc --no-deps
- run: cargo build --release
cli:
name: CLI
runs-on: ubuntu-latest
defaults:
run:
working-directory: cli
steps:
- uses: actions/checkout@v6
- run: sudo apt-get update && sudo apt-get install -y libudev-dev
- run: rustup toolchain install stable --profile minimal --component rustfmt,clippy
- run: cargo fmt --all -- --check
- run: cargo clippy -- -D warnings
- run: cargo build
- run: cargo build --release
ch32-v003:
name: CH32V003 (${{ matrix.chip }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
chip: [ch32v003f4p6, ch32v003a4m6, ch32v003f4u6, ch32v003j4m6]
steps:
- uses: actions/checkout@v6
- name: Install toolchain
run: rustup toolchain install nightly --profile minimal --component rust-src,rustfmt,clippy
- name: Fmt libraries
run: cd ch32 && cargo +nightly fmt --all -- --check
- name: Clippy libraries
run: cd ch32 && cargo +nightly clippy --no-default-features --features ${{ matrix.chip }} --target ../examples/ch32/v003/riscv32ec-unknown-none-elf.json -Zbuild-std=core -Zjson-target-spec -- -D warnings
- name: Build libraries
run: cd ch32 && cargo +nightly build --no-default-features --features ${{ matrix.chip }} --target ../examples/ch32/v003/riscv32ec-unknown-none-elf.json -Zbuild-std=core -Zjson-target-spec --release
- name: Clippy libraries (half-duplex)
run: cd ch32 && cargo +nightly clippy --no-default-features --features ${{ matrix.chip }},half-duplex --target ../examples/ch32/v003/riscv32ec-unknown-none-elf.json -Zbuild-std=core -Zjson-target-spec -- -D warnings
- name: Doc libraries
run: cd ch32 && cargo +nightly doc --no-default-features --features ${{ matrix.chip }} --target ../examples/ch32/v003/riscv32ec-unknown-none-elf.json -Zbuild-std=core -Zjson-target-spec --no-deps
- name: Fmt examples
run: cd examples/ch32/v003 && cargo +nightly fmt --all -- --check
- name: Clippy boot (system-flash)
run: cd examples/ch32/v003 && cargo +nightly clippy -p boot --no-default-features --features "${{ matrix.chip }},system-flash" -- -D warnings
- name: Build boot (system-flash)
run: cd examples/ch32/v003 && cargo +nightly build -p boot --no-default-features --features "${{ matrix.chip }},system-flash" --release
- name: Clippy boot (user-flash)
run: cd examples/ch32/v003 && cargo +nightly clippy -p boot --no-default-features --features "${{ matrix.chip }},user-flash" -- -D warnings
- name: Build boot (user-flash)
run: cd examples/ch32/v003 && cargo +nightly build -p boot --no-default-features --features "${{ matrix.chip }},user-flash" --release
- name: Clippy app (system-flash)
run: cd examples/ch32/v003 && cargo +nightly clippy -p app --no-default-features --features "${{ matrix.chip }},system-flash" -- -D warnings
- name: Build app (system-flash)
run: cd examples/ch32/v003 && cargo +nightly build -p app --no-default-features --features "${{ matrix.chip }},system-flash" --release
- name: Clippy app (user-flash)
run: cd examples/ch32/v003 && cargo +nightly clippy -p app --no-default-features --features "${{ matrix.chip }},user-flash" -- -D warnings
- name: Build app (user-flash)
run: cd examples/ch32/v003 && cargo +nightly build -p app --no-default-features --features "${{ matrix.chip }},user-flash" --release
ch32-v103:
name: CH32V103 (${{ matrix.chip }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
chip: [ch32v103c6t6, ch32v103c8t6, ch32v103c8u6, ch32v103r8t6]
steps:
- uses: actions/checkout@v6
- name: Install toolchain
run: |
rustup toolchain install stable --profile minimal --component rustfmt,clippy
rustup target add riscv32imc-unknown-none-elf
- name: Clippy libraries
run: cd ch32 && cargo clippy --no-default-features --features ${{ matrix.chip }} --target riscv32imc-unknown-none-elf -- -D warnings
- name: Build libraries
run: cd ch32 && cargo build --no-default-features --features ${{ matrix.chip }} --target riscv32imc-unknown-none-elf --release
- name: Clippy libraries (half-duplex)
run: cd ch32 && cargo clippy --no-default-features --features ${{ matrix.chip }},half-duplex --target riscv32imc-unknown-none-elf -- -D warnings
- name: Fmt examples
run: cd examples/ch32/v103 && cargo fmt --all -- --check
- name: Clippy boot (system-flash)
run: cd examples/ch32/v103 && cargo clippy -p boot --no-default-features --features "${{ matrix.chip }},system-flash" -- -D warnings
- name: Build boot (system-flash)
run: cd examples/ch32/v103 && cargo build -p boot --no-default-features --features "${{ matrix.chip }},system-flash" --release
- name: Clippy boot (user-flash)
run: cd examples/ch32/v103 && cargo clippy -p boot --no-default-features --features "${{ matrix.chip }},user-flash" -- -D warnings
- name: Build boot (user-flash)
run: cd examples/ch32/v103 && cargo build -p boot --no-default-features --features "${{ matrix.chip }},user-flash" --release
- name: Clippy app (system-flash)
run: cd examples/ch32/v103 && cargo clippy -p app --no-default-features --features "${{ matrix.chip }},system-flash" -- -D warnings
- name: Build app (system-flash)
run: cd examples/ch32/v103 && cargo build -p app --no-default-features --features "${{ matrix.chip }},system-flash" --release
- name: Clippy app (user-flash)
run: cd examples/ch32/v103 && cargo clippy -p app --no-default-features --features "${{ matrix.chip }},user-flash" -- -D warnings
- name: Build app (user-flash)
run: cd examples/ch32/v103 && cargo build -p app --no-default-features --features "${{ matrix.chip }},user-flash" --release