Skip to content

Commit 7cba362

Browse files
authored
Merge pull request #68 from probe-rs/nh/ci
Add CI
2 parents 4b21e8a + 0714334 commit 7cba362

File tree

1 file changed

+99
-0
lines changed

1 file changed

+99
-0
lines changed

.github/workflows/ci.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
build:
14+
name: Build (${{ matrix.target }})
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
target:
20+
# ARM Cortex-M targets
21+
- thumbv6m-none-eabi # Cortex-M0, M0+
22+
- thumbv7m-none-eabi # Cortex-M3
23+
- thumbv7em-none-eabi # Cortex-M4, M7 (no FPU)
24+
- thumbv7em-none-eabihf # Cortex-M4F, M7F (with FPU)
25+
- thumbv8m.base-none-eabi # Cortex-M23
26+
- thumbv8m.main-none-eabi # Cortex-M33, M35P (no FPU)
27+
- thumbv8m.main-none-eabihf # Cortex-M33F, M35PF (with FPU)
28+
# RISC-V targets
29+
- riscv32i-unknown-none-elf # RV32I base
30+
- riscv32imc-unknown-none-elf # RV32IMC (e.g., ESP32-C3)
31+
- riscv32imac-unknown-none-elf # RV32IMAC
32+
steps:
33+
- uses: actions/checkout@v4
34+
35+
- name: Install Rust
36+
uses: dtolnay/rust-toolchain@stable
37+
with:
38+
targets: ${{ matrix.target }}
39+
40+
- name: Build rtt-target
41+
run: cargo build -p rtt-target --target ${{ matrix.target }}
42+
43+
- name: Build rtt-target (all features)
44+
run: cargo build -p rtt-target --target ${{ matrix.target }} --all-features
45+
46+
- name: Build panic-rtt-target
47+
run: cargo build -p panic-rtt-target --target ${{ matrix.target }}
48+
49+
- name: Build panic-rtt-target (all features)
50+
run: cargo build -p panic-rtt-target --target ${{ matrix.target }} --all-features
51+
52+
docs:
53+
name: Test documentation builds
54+
runs-on: ubuntu-latest
55+
steps:
56+
- uses: actions/checkout@v4
57+
58+
- name: Install Rust
59+
uses: dtolnay/rust-toolchain@nightly
60+
61+
- name: Build rtt-target docs
62+
run: cargo doc -p rtt-target --all-features --no-deps
63+
env:
64+
RUSTDOCFLAGS: "--cfg docsrs"
65+
66+
- name: Build panic-rtt-target docs
67+
run: cargo doc -p panic-rtt-target --all-features --no-deps
68+
69+
format:
70+
name: Check formatting
71+
runs-on: ubuntu-latest
72+
steps:
73+
- uses: actions/checkout@v4
74+
75+
- name: Install Rust
76+
uses: dtolnay/rust-toolchain@stable
77+
with:
78+
components: rustfmt
79+
80+
- name: Check formatting
81+
run: cargo fmt --all -- --check
82+
83+
clippy:
84+
name: Run Clippy
85+
runs-on: ubuntu-latest
86+
steps:
87+
- uses: actions/checkout@v4
88+
89+
- name: Install Rust
90+
uses: dtolnay/rust-toolchain@stable
91+
with:
92+
components: clippy
93+
targets: thumbv7em-none-eabihf
94+
95+
- name: Clippy rtt-target
96+
run: cargo clippy -p rtt-target --target thumbv7em-none-eabihf --all-features -- -D warnings
97+
98+
- name: Clippy panic-rtt-target
99+
run: cargo clippy -p panic-rtt-target --target thumbv7em-none-eabihf --all-features -- -D warnings

0 commit comments

Comments
 (0)