Skip to content

Commit 57f5c17

Browse files
committed
ci: update CI tooling
1 parent f15ae73 commit 57f5c17

File tree

9 files changed

+48
-97
lines changed

9 files changed

+48
-97
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
on:
22
push:
3-
branches: [ staging, trying, master ]
3+
branches: [ master ]
44
pull_request:
55

66
name: Continuous integration
@@ -22,31 +22,22 @@ jobs:
2222
FLAGS: rt
2323

2424
steps:
25-
- uses: actions/checkout@v2
25+
- uses: actions/checkout@v4
2626
- name: Cache cargo registry and index
27-
uses: actions/cache@v2
27+
uses: actions/cache@v4
2828
with:
2929
path: |
3030
~/.cargo/registry
3131
~/.cargo/git
3232
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
3333
- name: Cache cargo build
34-
uses: actions/cache@v2
34+
uses: actions/cache@v4
3535
with:
3636
path: target
3737
key: ${{ runner.os }}-target-${{ matrix.rust }}-${{ hashFiles('**/Cargo.toml') }}-memory-${{ hashFiles('**/*.x') }}
38-
- uses: actions-rs/toolchain@v1
39-
with:
40-
profile: minimal
41-
toolchain: ${{ matrix.rust }}
42-
target: thumbv8m.main-none-eabihf
43-
override: true
44-
- uses: actions-rs/cargo@v1
45-
with:
46-
use-cross: true
47-
command: build
48-
args: --verbose --release --examples --target thumbv8m.main-none-eabihf --features ${{ matrix.mcu }},${{ env.FLAGS }}
49-
- uses: actions-rs/cargo@v1
50-
with:
51-
command: test
52-
args: --lib --target x86_64-unknown-linux-gnu --features ${{ matrix.mcu }},${{ env.FLAGS }}
38+
- name: Install thumbv8m rust target
39+
run: rustup target add thumbv8m.main-none-eabihf
40+
- name: Build
41+
run: cargo build --verbose --release --examples --target thumbv8m.main-none-eabihf --features ${{ matrix.mcu }},${{ env.FLAGS }}
42+
- name: Test
43+
run: cargo test --lib --target x86_64-unknown-linux-gnu --features ${{ matrix.mcu }},${{ env.FLAGS }}

.github/workflows/clippy.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
11
on:
22
pull_request:
33
push:
4-
branches: [staging, trying, master]
4+
branches: [master]
55

66
name: Clippy
77

88
jobs:
99
clippy_check:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
13-
- uses: actions-rs/toolchain@v1
14-
with:
15-
components: clippy
16-
toolchain: 1.69.0
17-
target: thumbv8m.main-none-eabihf
18-
override: true
19-
- uses: actions-rs/clippy-check@v1
20-
with:
21-
token: ${{ secrets.GITHUB_TOKEN }}
22-
args: --examples --target thumbv8m.main-none-eabihf --features=rt,stm32h503 -- -D warnings
12+
- uses: actions/checkout@v4
13+
- name: Install thumb8 rust target
14+
run: rustup target add thumbv8m.main-none-eabihf
15+
- name: Cargo clippy
16+
run: cargo clippy --examples --target thumbv8m.main-none-eabihf --features=rt,stm32h503 -- -D warnings

.github/workflows/nightly.yml

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ jobs:
1414
matrix:
1515
mcu:
1616
- stm32h503
17-
- stm32h562
18-
- stm32h563
19-
- stm32h573
2017
logging: # Example logging options
2118
- log-itm
2219
- log-semihost
@@ -25,31 +22,24 @@ jobs:
2522
FLAGS: rt
2623

2724
steps:
28-
- uses: actions/checkout@v2
25+
- uses: actions/checkout@v4
2926
- name: Cache cargo registry and index
30-
uses: actions/cache@v2
27+
uses: actions/cache@v4
3128
with:
3229
path: |
3330
~/.cargo/registry
3431
~/.cargo/git
3532
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
3633
- name: Cache cargo build
37-
uses: actions/cache@v2
34+
uses: actions/cache@v4
3835
with:
3936
path: target
4037
key: ${{ runner.os }}-target-nightly-${{ hashFiles('**/Cargo.toml') }}-memory-${{ hashFiles('**/*.x') }}
41-
- uses: actions-rs/toolchain@v1
42-
with:
43-
profile: minimal
44-
toolchain: nightly
45-
target: thumbv8m.main-none-eabihf
46-
override: true
47-
- uses: actions-rs/cargo@v1
48-
with:
49-
use-cross: true
50-
command: build
51-
args: --verbose --release --examples --target thumbv8m.main-none-eabihf --features ${{ matrix.mcu }},${{ env.FLAGS }},${{ matrix.logging }}
52-
- uses: actions-rs/cargo@v1
53-
with:
54-
command: test
55-
args: --lib --target x86_64-unknown-linux-gnu --features ${{ matrix.mcu }},${{ env.FLAGS }}
38+
- name: Install nightly toolchain
39+
run: rustup toolchain install nightly
40+
- name: Install thumbv8m rust target
41+
run: rustup +nightly target add thumbv8m.main-none-eabihf
42+
- name: Build
43+
run: cargo +nightly build --verbose --release --examples --target thumbv8m.main-none-eabihf --features ${{ matrix.mcu }},${{ env.FLAGS }},${{ matrix.logging }}
44+
- name: Test
45+
run: cargo +nightly test --lib --target x86_64-unknown-linux-gnu --features ${{ matrix.mcu }},${{ env.FLAGS }}

.github/workflows/rustfmt.yml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,15 @@
11
on:
22
push:
3-
branches: [ staging, trying, master ]
3+
branches: [ master ]
44
pull_request:
55

6-
name: Code formatting check
6+
name: rustfmt
77

88
jobs:
99
fmt:
1010
name: Rustfmt
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
14-
- uses: actions-rs/toolchain@v1
15-
with:
16-
profile: minimal
17-
toolchain: stable
18-
override: true
19-
- run: rustup component add rustfmt
20-
- uses: actions-rs/cargo@v1
21-
with:
22-
command: fmt
23-
args: --all -- --check
13+
- uses: actions/checkout@v4
14+
- name: Check formatting
15+
run: cargo fmt --all -- --check

.github/workflows/version-match.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
on:
22
push:
3-
branches: [ staging, trying, master ]
3+
branches: [ master ]
44
pull_request:
55

66
name: Verify rustc versions match
@@ -10,6 +10,6 @@ jobs:
1010
name: Rustc version match
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
14-
- uses: actions/setup-node@v3
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-node@v4
1515
- run: node tools/verify-rust-version.js

examples/blinky.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,22 @@ use stm32h5xx_hal::pac;
1010
fn main() -> ! {
1111
utilities::logger::init();
1212

13-
let cp = cortex_m::Peripherals::take().unwrap();
1413
let dp = pac::Peripherals::take().unwrap();
1514

1615
// TODO: Power/clock config is required before blinky can... blink.
1716

18-
dp.GPIOA.moder.write(|w| w.mode5().variant(1)); // output
19-
dp.GPIOA.pupdr.write(|w| w.pupd5().variant(1)); // pull-up
17+
dp.GPIOA.moder().write(|w| w.mode5().output()); // output
18+
dp.GPIOA.pupdr().write(|w| w.pupd5().pull_up()); // pull-up
2019

2120
// dp.GPIOA.odr.write(|w| w.od5().set_bit());
2221

2322
loop {
24-
dp.GPIOA.odr.write(|w| w.od5().clear_bit());
25-
for _ in 0..1_000_0 {
23+
dp.GPIOA.odr().write(|w| w.od5().low());
24+
for _ in 0..10_000 {
2625
cortex_m::asm::nop();
2726
}
28-
dp.GPIOA.odr.write(|w| w.od5().set_bit());
29-
for _ in 0..1_000_0 {
27+
dp.GPIOA.odr().write(|w| w.od5().high());
28+
for _ in 0..10_000 {
3029
cortex_m::asm::nop();
3130
}
3231
}

examples/utilities/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
//! Utilities for examples
22
33
pub mod logger;
4-
#[macro_use]
5-
mod power;

examples/utilities/power.rs

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/lib.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ compile_error!("Cannot not select both rm0492 and rm0481");
1818
#[cfg(feature = "stm32h503")]
1919
pub use stm32h5::stm32h503 as stm32;
2020

21-
#[cfg(any(
22-
feature = "stm32h562",
23-
feature = "stm32h563",
24-
feature = "stm32h573",
25-
))]
21+
#[cfg(feature = "stm32h562")]
22+
pub use stm32h5::stm32h562 as stm32;
23+
24+
#[cfg(feature = "stm32h563")]
25+
pub use stm32h5::stm32h563 as stm32;
26+
27+
#[cfg(feature = "stm32h573")]
2628
pub use stm32h5::stm32h573 as stm32;
2729

2830
#[cfg(feature = "device-selected")]

0 commit comments

Comments
 (0)