Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix min-versions; add min-version CI check #26

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 47 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,36 @@ jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- run: rustup component add rustfmt
- name: Check library formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: --verbose --all -- --check


cortex-m-compat:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy
target: thumbv7em-none-eabihf
override: true
profile: minimal
- name: Check cortex-m compatibility
uses: actions-rs/cargo@v1
with:
command: build
args: --manifest-path i-need-min-cm/Cargo.toml

# For each chip, build and lint the main library
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
Expand All @@ -42,20 +59,45 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Run unit and documentation tests
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose

# Check if dependency versions in Cargo.toml are updated correctly
min-versions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: thumbv7em-none-eabihf

- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@nightly

- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
- name: Install cargo-minimal-versions
uses: taiki-e/install-action@cargo-minimal-versions

- name: Check with minimal versions
run: cargo +stable minimal-versions check --all-features

- name: Run tests with minimal versions
run: cargo +stable minimal-versions test

# Make sure documentation builds, and doclinks are valid
doc:
env:
RUSTDOCFLAGS: -D warnings
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Check documentation and doclinks
uses: actions-rs/cargo@v1
with:
Expand Down
7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ exclude = [

[dependencies]
bitflags = "2"
cortex-m = "0.7"
cortex-m = "0.7.4"
ral-registers = "0.1"
usb-device = "0.3"
usb-device = "0.3.1"

[dependencies.defmt-03]
package = "defmt"
Expand All @@ -30,6 +30,9 @@ optional = true
[features]
"defmt-03" = ["dep:defmt-03", "usb-device/defmt"]

[workspace]
exclude = ["i-need-min-cm"]

[package.metadata.docs.rs]
default-target = "thumbv7em-none-eabihf"

Expand Down
7 changes: 7 additions & 0 deletions i-need-min-cm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]
name = "i-need-min-cm"
version = "0.1.0"

[dependencies]
cortex-m = "=0.7.0"
imxrt-usbd = { path = ".." }
2 changes: 2 additions & 0 deletions i-need-min-cm/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
use cortex_m as _;
use imxrt_usbd as _;
Loading