Skip to content

Commit 15aa2cd

Browse files
authored
Merge pull request #124 from ra-kete/github-actions
Move CI to GitHub Actions
2 parents 5426b17 + ee261b4 commit 15aa2cd

File tree

10 files changed

+97
-102
lines changed

10 files changed

+97
-102
lines changed

.github/workflows/ci.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Note: The checkout@v2 action sometimes checks out the wrong commit:
2+
# https://github.com/actions/checkout/issues/237
3+
# Until that is fixed we use checkout@v1 here instead.
4+
5+
name: CI
6+
7+
on:
8+
push:
9+
branches: [master]
10+
pull_request:
11+
12+
jobs:
13+
check:
14+
name: Check
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
mcu:
19+
- stm32f301
20+
- stm32f318
21+
- stm32f302xb
22+
- stm32f302xc
23+
- stm32f302xd
24+
- stm32f302xe
25+
- stm32f303xb
26+
- stm32f303xc
27+
- stm32f303xd
28+
- stm32f303xe
29+
- stm32f303x6
30+
- stm32f303x8
31+
- stm32f373
32+
- stm32f378
33+
- stm32f334
34+
- stm32f328
35+
- stm32f358
36+
- stm32f398
37+
features: ["rt"]
38+
include:
39+
- mcu: stm32f303xc
40+
features: rt,stm32-usbd
41+
steps:
42+
- uses: actions/checkout@v1
43+
- uses: actions-rs/toolchain@v1
44+
with:
45+
toolchain: stable
46+
target: thumbv7em-none-eabihf
47+
override: true
48+
profile: minimal
49+
- uses: actions-rs/cargo@v1
50+
with:
51+
command: check
52+
args: --features=${{ matrix.mcu }},${{ matrix.features }} --examples
53+
54+
clippy:
55+
name: Clippy
56+
runs-on: ubuntu-latest
57+
steps:
58+
- uses: actions/checkout@v1
59+
- uses: actions-rs/toolchain@v1
60+
with:
61+
toolchain: nightly
62+
target: thumbv7em-none-eabihf
63+
override: true
64+
profile: minimal
65+
components: clippy
66+
- uses: actions-rs/clippy-check@v1
67+
with:
68+
token: ${{ secrets.GITHUB_TOKEN }}
69+
args: >
70+
--features=stm32f303xc,rt,stm32-usbd --examples
71+
-- -D warnings
72+
73+
rustfmt:
74+
name: Rustfmt
75+
runs-on: ubuntu-latest
76+
steps:
77+
- uses: actions/checkout@v1
78+
- uses: actions-rs/toolchain@v1
79+
with:
80+
toolchain: stable
81+
override: true
82+
profile: minimal
83+
components: rustfmt
84+
- uses: actions-rs/cargo@v1
85+
with:
86+
command: fmt
87+
args: --all -- --check

.github/workflows/rust.yml

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

.travis.yml

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

Cargo.toml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ version = "0.5.0"
1515
features = ["stm32f303xc", "rt", "stm32-usbd"]
1616
targets = ["thumbv7em-none-eabihf"]
1717

18-
[badges]
19-
travis-ci = { repository = "stm32-rs/stm32f3xx-hal" }
20-
2118
[dependencies]
2219
cortex-m = "0.6"
2320
cortex-m-rt = "0.6"
@@ -53,10 +50,13 @@ cortex-m-semihosting = "0.3"
5350

5451
[features]
5552
default = ["unproven"]
53+
unproven = ["embedded-hal/unproven"]
5654
device-selected = []
5755
direct-call-deprecated = []
5856
rt = ["stm32f3/rt"]
59-
# Any Changes here should be mirrored in README.md and src/lib.rs
57+
58+
# Any Changes here should be mirrored in README.md, src/lib.rs, and
59+
# .github/workflows/ci.yml.
6060
stm32f301 = ["stm32f3/stm32f301", "device-selected"]
6161
stm32f318 = ["stm32f3/stm32f301", "device-selected"]
6262
stm32f302 = ["stm32f3/stm32f302", "direct-call-deprecated"]
@@ -77,7 +77,6 @@ stm32f334 = ["stm32f3/stm32f3x4", "device-selected"]
7777
stm32f328 = ["stm32f3/stm32f3x8", "device-selected"]
7878
stm32f358 = ["stm32f3/stm32f3x8", "device-selected"]
7979
stm32f398 = ["stm32f3/stm32f3x8", "device-selected"]
80-
unproven = ["embedded-hal/unproven"]
8180

8281
[profile.dev]
8382
debug = true

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# stm32f3xx-hal
22

3-
[![Build Status](https://travis-ci.com/stm32-rs/stm32f3xx-hal.svg)](https://travis-ci.com/stm32-rs/stm32f3xx-hal)
3+
[![Build Status](https://github.com/stm32-rs/stm32f3xx-hal/workflows/CI/badge.svg)](https://github.com/stm32-rs/stm32f3xx-hal/actions)
44
[![Crate](https://img.shields.io/crates/v/stm32f3xx-hal.svg)](https://crates.io/crates/stm32f3xx-hal)
55
[![Docs](https://docs.rs/stm32f3xx-hal/badge.svg)](https://docs.rs/stm32f3xx-hal)
66

ci/build.py

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

examples/spi.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ fn main() -> ! {
4949

5050
// Create an `u8` array, which can be transfered via SPI.
5151
let msg_send: [u8; 8] = [0xD, 0xE, 0xA, 0xD, 0xB, 0xE, 0xE, 0xF];
52-
// Clone the array, as it would be mutually shared in `transfer` while simultaniously would be
52+
// Copy the array, as it would be mutually shared in `transfer` while simultaneously would be
5353
// immutable shared in `assert_eq`.
54-
let mut msg_sending = msg_send.clone();
54+
let mut msg_sending = msg_send;
5555
// Transfer the content of the array via SPI and receive it's output.
5656
// When MOSI and MISO pins are connected together, `msg_received` should receive the content.
5757
// from `msg_sending`

src/i2c.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ use crate::time::Hertz;
2727

2828
/// I2C error
2929
#[derive(Debug)]
30+
#[non_exhaustive]
3031
pub enum Error {
3132
/// Bus error
3233
Bus,
@@ -36,8 +37,6 @@ pub enum Error {
3637
// Pec, // SMBUS mode only
3738
// Timeout, // SMBUS mode only
3839
// Alert, // SMBUS mode only
39-
#[doc(hidden)]
40-
_Extensible,
4140
}
4241

4342
// FIXME these should be "closed" traits

src/serial.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ pub enum Event {
5252

5353
/// Serial error
5454
#[derive(Debug)]
55+
#[non_exhaustive]
5556
pub enum Error {
5657
/// Framing error
5758
Framing,
@@ -61,8 +62,6 @@ pub enum Error {
6162
Overrun,
6263
/// Parity check error
6364
Parity,
64-
#[doc(hidden)]
65-
_Extensible,
6665
}
6766

6867
// FIXME these should be "closed" traits

src/spi.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,14 @@ use crate::time::Hertz;
4949

5050
/// SPI error
5151
#[derive(Debug)]
52+
#[non_exhaustive]
5253
pub enum Error {
5354
/// Overrun occurred
5455
Overrun,
5556
/// Mode fault occurred
5657
ModeFault,
5758
/// CRC error
5859
Crc,
59-
#[doc(hidden)]
60-
_Extensible,
6160
}
6261

6362
// FIXME these should be "closed" traits

0 commit comments

Comments
 (0)