Skip to content

Commit 416aa2b

Browse files
bors[bot]Dirbaioeldruin
authored
Merge #394
394: Split nb and can traits to separate crates. r=eldruin a=Dirbaio Following up from #177 (comment), this PR splits `nb` and `can` traits to separate crates. I propose keeping these crates (and `embedded-hal-async`) separate forever. (instead of merging EHA into EH when stable as we originally planned when we created EHA). Reasons for splitting `nb`: - its future is unclear. Some people who would like to see `nb` deprecated. By splitting, if we do deprecate it, we won't get stuck with it in the main `embedded-hal` crate forever. - It makes the module paths in the main crate cleaner. - Traits tied to a particular "execution model" in their own crates, which make the overall structure easier to understand IMO. Reasons for splitting `can`: - It has some open concerns: #381 #387 - Even if we do solve these, it's nice to have separate crates for the "more specialized" traits so that they can be major-bumped in the future if more concerns arise, without having to major-bump the main `embedded-hal` crate. TODO: - [x] Name it `embedded-can`, not `embedded-hal-can`. - [x] Move/remove docs/examples from the main crate that mention `nb`. - [x] Mention the subcrates from the main crate's docs. - [x] Add CI - [x] move `embedded-hal` to a subdir as well - [x] What should the nb, can crate versions be? 1.0? (no opinion on this from me). - [x] can: 0.4 - [x] nb: 1.0 Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net> Co-authored-by: Diego Barrios Romero <eldruin@gmail.com>
2 parents bd0228b + c48550c commit 416aa2b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+978
-1013
lines changed

.github/bors.toml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@ block_labels = ["needs-decision"]
22
delete_merged_branches = true
33
required_approvals = 1
44
status = [
5-
"ci-linux (stable, x86_64-unknown-linux-gnu)",
6-
"ci-linux (stable, thumbv6m-none-eabi)",
7-
"ci-linux (stable, thumbv7m-none-eabi)",
8-
"ci-linux (1.54.0, x86_64-unknown-linux-gnu)",
9-
"ci-linux-test (stable)",
10-
"ci-linux-test (1.54.0, x86_64-unknown-linux-gnu)",
5+
"test (stable, x86_64-unknown-linux-gnu)",
6+
"test (stable, thumbv6m-none-eabi)",
7+
"test (stable, thumbv7m-none-eabi)",
8+
"test (1.54.0, x86_64-unknown-linux-gnu)",
9+
"test (1.54.0, thumbv6m-none-eabi)",
10+
"test (1.54.0, thumbv7m-none-eabi)",
11+
"test (nightly, x86_64-unknown-linux-gnu)",
12+
"test (nightly, thumbv6m-none-eabi)",
13+
"test (nightly, thumbv7m-none-eabi)",
1114
"fmt",
1215
]

.github/workflows/changelog.yml

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

.github/workflows/ci-async.yml

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

.github/workflows/ci-bus.yml

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

.github/workflows/ci.yml

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

.github/workflows/clippy-async.yml

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

.github/workflows/clippy-bus.yml

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

.github/workflows/clippy.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@ on:
55

66
name: Clippy check
77
jobs:
8-
clippy_check:
8+
clippy:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v2
1212
- uses: actions-rs/toolchain@v1
1313
with:
1414
profile: minimal
15-
toolchain: stable
15+
# embedded-hal-async needs nightly.
16+
# Use a pinned version to avoid spontaneous breakages (new clippy lints are added often)
17+
toolchain: nightly-2022-09-05
1618
override: true
1719
components: clippy
1820
- uses: actions-rs/clippy-check@v1

.github/workflows/rustfmt.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,4 @@ jobs:
1616
toolchain: nightly
1717
override: true
1818
components: rustfmt
19-
- uses: actions-rs/cargo@v1
20-
with:
21-
command: fmt
22-
args: --all -- --check
23-
- run: cargo fmt --all -- --check
24-
working-directory: embedded-hal-async
19+
- run: cargo fmt --check

.github/workflows/test.yml

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,41 @@ on:
33
branches: [ staging, trying, master ]
44
pull_request:
55

6-
name: Test Suite
6+
name: Continuous integration
77

88
env:
99
RUSTFLAGS: '--deny warnings'
1010

1111
jobs:
12-
ci-linux-test:
12+
test:
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
16-
rust: [stable]
16+
# All generated code should be running on stable now
17+
rust:
18+
- stable
19+
- 1.54.0 # MSRV
20+
- nightly
1721

18-
include:
19-
- rust: 1.54.0
20-
TARGET: x86_64-unknown-linux-gnu
21-
22-
# Test nightly but don't fail
23-
- rust: nightly
24-
experimental: true
25-
TARGET: x86_64-unknown-linux-gnu
22+
# The default target we're compiling on and for
23+
target:
24+
- x86_64-unknown-linux-gnu
25+
- thumbv6m-none-eabi
26+
- thumbv7m-none-eabi
2627

2728
steps:
2829
- uses: actions/checkout@v2
2930
- uses: actions-rs/toolchain@v1
3031
with:
3132
profile: minimal
3233
toolchain: ${{ matrix.rust }}
33-
target: ${{ matrix.TARGET }}
34+
target: ${{ matrix.target }}
3435
override: true
35-
- uses: actions-rs/cargo@v1
36-
with:
37-
command: test
36+
37+
- run: sed -i '/nightly-only/d' Cargo.toml
38+
if: matrix.toolchain != 'nightly'
39+
40+
- run: cargo check --target=${{ matrix.target }}
41+
42+
- run: cargo test --target=${{ matrix.target }}
43+
if: contains(matrix.target, 'linux')

0 commit comments

Comments
 (0)