Skip to content

Commit

Permalink
Merge pull request #124 from ra-kete/github-actions
Browse files Browse the repository at this point in the history
Move CI to GitHub Actions
  • Loading branch information
teskje committed Jul 25, 2020
2 parents 5426b17 + ee261b4 commit 15aa2cd
Show file tree
Hide file tree
Showing 10 changed files with 97 additions and 102 deletions.
87 changes: 87 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Note: The checkout@v2 action sometimes checks out the wrong commit:
# https://github.com/actions/checkout/issues/237
# Until that is fixed we use checkout@v1 here instead.

name: CI

on:
push:
branches: [master]
pull_request:

jobs:
check:
name: Check
runs-on: ubuntu-latest
strategy:
matrix:
mcu:
- stm32f301
- stm32f318
- stm32f302xb
- stm32f302xc
- stm32f302xd
- stm32f302xe
- stm32f303xb
- stm32f303xc
- stm32f303xd
- stm32f303xe
- stm32f303x6
- stm32f303x8
- stm32f373
- stm32f378
- stm32f334
- stm32f328
- stm32f358
- stm32f398
features: ["rt"]
include:
- mcu: stm32f303xc
features: rt,stm32-usbd
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: thumbv7em-none-eabihf
override: true
profile: minimal
- uses: actions-rs/cargo@v1
with:
command: check
args: --features=${{ matrix.mcu }},${{ matrix.features }} --examples

clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
target: thumbv7em-none-eabihf
override: true
profile: minimal
components: clippy
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: >
--features=stm32f303xc,rt,stm32-usbd --examples
-- -D warnings
rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
components: rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
22 changes: 0 additions & 22 deletions .github/workflows/rust.yml

This file was deleted.

18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

9 changes: 4 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ version = "0.5.0"
features = ["stm32f303xc", "rt", "stm32-usbd"]
targets = ["thumbv7em-none-eabihf"]

[badges]
travis-ci = { repository = "stm32-rs/stm32f3xx-hal" }

[dependencies]
cortex-m = "0.6"
cortex-m-rt = "0.6"
Expand Down Expand Up @@ -53,10 +50,13 @@ cortex-m-semihosting = "0.3"

[features]
default = ["unproven"]
unproven = ["embedded-hal/unproven"]
device-selected = []
direct-call-deprecated = []
rt = ["stm32f3/rt"]
# Any Changes here should be mirrored in README.md and src/lib.rs

# Any Changes here should be mirrored in README.md, src/lib.rs, and
# .github/workflows/ci.yml.
stm32f301 = ["stm32f3/stm32f301", "device-selected"]
stm32f318 = ["stm32f3/stm32f301", "device-selected"]
stm32f302 = ["stm32f3/stm32f302", "direct-call-deprecated"]
Expand All @@ -77,7 +77,6 @@ stm32f334 = ["stm32f3/stm32f3x4", "device-selected"]
stm32f328 = ["stm32f3/stm32f3x8", "device-selected"]
stm32f358 = ["stm32f3/stm32f3x8", "device-selected"]
stm32f398 = ["stm32f3/stm32f3x8", "device-selected"]
unproven = ["embedded-hal/unproven"]

[profile.dev]
debug = true
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# stm32f3xx-hal

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

Expand Down
48 changes: 0 additions & 48 deletions ci/build.py

This file was deleted.

4 changes: 2 additions & 2 deletions examples/spi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ fn main() -> ! {

// Create an `u8` array, which can be transfered via SPI.
let msg_send: [u8; 8] = [0xD, 0xE, 0xA, 0xD, 0xB, 0xE, 0xE, 0xF];
// Clone the array, as it would be mutually shared in `transfer` while simultaniously would be
// Copy the array, as it would be mutually shared in `transfer` while simultaneously would be
// immutable shared in `assert_eq`.
let mut msg_sending = msg_send.clone();
let mut msg_sending = msg_send;
// Transfer the content of the array via SPI and receive it's output.
// When MOSI and MISO pins are connected together, `msg_received` should receive the content.
// from `msg_sending`
Expand Down
3 changes: 1 addition & 2 deletions src/i2c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use crate::time::Hertz;

/// I2C error
#[derive(Debug)]
#[non_exhaustive]
pub enum Error {
/// Bus error
Bus,
Expand All @@ -36,8 +37,6 @@ pub enum Error {
// Pec, // SMBUS mode only
// Timeout, // SMBUS mode only
// Alert, // SMBUS mode only
#[doc(hidden)]
_Extensible,
}

// FIXME these should be "closed" traits
Expand Down
3 changes: 1 addition & 2 deletions src/serial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ pub enum Event {

/// Serial error
#[derive(Debug)]
#[non_exhaustive]
pub enum Error {
/// Framing error
Framing,
Expand All @@ -61,8 +62,6 @@ pub enum Error {
Overrun,
/// Parity check error
Parity,
#[doc(hidden)]
_Extensible,
}

// FIXME these should be "closed" traits
Expand Down
3 changes: 1 addition & 2 deletions src/spi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,14 @@ use crate::time::Hertz;

/// SPI error
#[derive(Debug)]
#[non_exhaustive]
pub enum Error {
/// Overrun occurred
Overrun,
/// Mode fault occurred
ModeFault,
/// CRC error
Crc,
#[doc(hidden)]
_Extensible,
}

// FIXME these should be "closed" traits
Expand Down

0 comments on commit 15aa2cd

Please sign in to comment.