diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 231a1de..e11a916 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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: diff --git a/Cargo.toml b/Cargo.toml index fa34463..457bdd3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" @@ -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" diff --git a/i-need-min-cm/Cargo.toml b/i-need-min-cm/Cargo.toml new file mode 100644 index 0000000..b868fef --- /dev/null +++ b/i-need-min-cm/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "i-need-min-cm" +version = "0.1.0" + +[dependencies] +cortex-m = "=0.7.0" +imxrt-usbd = { path = ".." } diff --git a/i-need-min-cm/src/lib.rs b/i-need-min-cm/src/lib.rs new file mode 100644 index 0000000..8cd3942 --- /dev/null +++ b/i-need-min-cm/src/lib.rs @@ -0,0 +1,2 @@ +use cortex_m as _; +use imxrt_usbd as _;