Skip to content

Commit

Permalink
core: Fix no_std build and run CI on nightly cron (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
antangelo authored Jul 23, 2023
1 parent 4c5254b commit 9a0654d
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 35 deletions.
35 changes: 1 addition & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
tags:
- v*
pull_request:
name: CI
name: Build

jobs:
check:
Expand Down Expand Up @@ -41,39 +41,6 @@ jobs:
command: clippy
args: --all -- -D warnings

build_lib_no_std:
name: Build (xdvdfs-no_std)
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3

- name: Install Rust nightly
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: clippy

- name: Check lints
uses: actions-rs/cargo@v1
with:
command: clippy
args: -p xdvdfs --no-default-features --features=read -- -D warnings

- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: -p xdvdfs --no-default-features --features=read

- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: -p xdvdfs --no-default-features --features=read

build_lib:
name: Build (xdvdfs)
runs-on: ubuntu-latest
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/nostd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
on:
push:
branches:
- main
tags:
- v*
pull_request:
schedule:
- cron: '0 0 * * *'
name: Build (no_std)

jobs:
build_lib_no_std:
name: Build (xdvdfs-no_std)
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3

- name: Install Rust nightly
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: clippy

- name: Check lints
uses: actions-rs/cargo@v1
with:
command: clippy
args: -p xdvdfs --no-default-features --features=read -- -D warnings

- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: -p xdvdfs --no-default-features --features=read

- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: -p xdvdfs --no-default-features --features=read

1 change: 1 addition & 0 deletions xdvdfs-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ arrayvec = { version = "0.7.2", default-features = false }
async-trait = { version = "0.1.68" }
encoding_rs = "0.8.32"
log = { version = "0.4.17", optional = true }
rustversion = "1.0.14"

[features]
default = ["std", "read", "write", "logging"]
Expand Down
2 changes: 1 addition & 1 deletion xdvdfs-core/src/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ impl DirectoryEntryData {

impl PartialOrd for DirectoryEntryData {
fn partial_cmp(&self, other: &Self) -> Option<core::cmp::Ordering> {
Some(Ord::cmp(self, other))
Some(self.cmp(other))
}
}

Expand Down
2 changes: 2 additions & 0 deletions xdvdfs-core/src/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ use super::util;

/// Read the XDVDFS volume descriptor from sector 32 of the drive
/// Returns None if the volume descriptor is invalid
// Clippy bug (https://github.com/rust-lang/rust-clippy/issues/11216) returns a false positive
#[rustversion::attr(nightly, allow(clippy::needless_pass_by_ref_mut))]
pub async fn read_volume<E>(
dev: &mut impl BlockDeviceRead<E>,
) -> Result<VolumeDescriptor, util::Error<E>> {
Expand Down

0 comments on commit 9a0654d

Please sign in to comment.