Skip to content

Commit 0a24042

Browse files
committed
ci: add test and format workflow
Signed-off-by: zhujunxing <zjx1319@hust.edu.cn>
1 parent 29941cb commit 0a24042

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

.github/workflows/test-and-format.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Test and Format
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
fmt:
12+
name: Format
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions-rust-lang/setup-rust-toolchain@v1
17+
with:
18+
components: rustfmt
19+
- name: Cache Dependencies
20+
uses: Swatinem/rust-cache@v2
21+
- name: Rustfmt Check
22+
uses: actions-rust-lang/rustfmt@v1
23+
24+
test:
25+
name: Test
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v4
29+
- uses: actions-rust-lang/setup-rust-toolchain@v1
30+
with:
31+
toolchain: nightly
32+
- uses: Swatinem/rust-cache@v2
33+
- name: Run tests
34+
run: |
35+
cargo test --workspace --exclude sophgo-rom-rt

sophgo-hal/src/gpio.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ impl<A: BaseAddress, const I: u8, M> Gpio<A, I, M> {
8888
/// Gets ownership of pad from `PwrPads`, configures it as a pull up output
8989
/// to drive an LED.
9090
///
91-
/// ```no_run
91+
/// ```ignore
9292
/// let pad_led = p.pwr_pads.gpio2.into_function(&p.pinmux);
9393
/// let mut led = p.pwr_gpio.a2.into_pull_up_output(pad_led);
9494
/// ```

0 commit comments

Comments
 (0)