Skip to content

Commit

Permalink
fix ci (#300)
Browse files Browse the repository at this point in the history
  • Loading branch information
quininer authored Aug 17, 2024
1 parent a4b65d0 commit 0a2283a
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 51 deletions.
58 changes: 17 additions & 41 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,45 +12,24 @@ jobs:
matrix:
target:
- x86_64-unknown-linux-gnu
- aarch64-unknown-linux-gnu

steps:
- uses: actions/checkout@v4
- uses: actions-rs/cargo@v1
with:
command: test
use-cross: true
args: --target ${{ matrix.target }}
- uses: actions-rs/cargo@v1
with:
command: run
use-cross: true
# Only run the test package on x86 until we find an ergonomic way
# to virtualize aarch64
args: --package io-uring-test --features io-uring-test/ci --target x86_64-unknown-linux-gnu
- uses: dtolnay/rust-toolchain@stable
- name: Test
run: cargo run --package io-uring-test --features io-uring-test/ci --target ${{ matrix.target }}

check-bench:
runs-on: ubuntu-latest

strategy:
fail-fast: false

matrix:
target:
- x86_64-unknown-linux-gnu

steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
components: clippy
override: true
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --package io-uring-bench
- uses: dtolnay/rust-toolchain@stable
- name: Bench
run: cargo bench --package io-uring-bench

check:
runs-on: ubuntu-latest
Expand All @@ -60,7 +39,7 @@ jobs:

matrix:
toolchain:
- nightly
- stable
- "1.48"
target:
- x86_64-unknown-linux-gnu
Expand All @@ -70,26 +49,23 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
target: ${{ matrix.target }}
components: clippy
override: true
- uses: actions-rs/clippy-check@v1
- uses: dtolnay/rust-toolchain@stable
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --target ${{ matrix.target }}
toolchain: ${{ matrix.toolchain }}
target: ${{ matrix.target }}
components: clippy
override: true
- name: Lint
run: cargo clippy --target ${{ matrix.target }}

fmt:
name: fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: rustup update stable
- name: Install rustfmt
run: rustup component add rustfmt
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt

- name: "rustfmt --check"
run: |
Expand Down
2 changes: 1 addition & 1 deletion io-uring-test/src/tests/futex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fn syscall_futex(futex: *const u32, op: libc::c_int, val: u32) -> io::Result<i64
)
};
if ret >= 0 {
Ok(ret)
Ok(ret as _)
} else {
Err(io::Error::from_raw_os_error(-ret as _))
}
Expand Down
4 changes: 2 additions & 2 deletions io-uring-test/src/tests/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1661,11 +1661,11 @@ pub fn test_udp_sendzc_with_dest<S: squeue::EntryMarker, C: cqueue::EntryMarker>
33 => match cqe.result() {
// First SendZc notification
11 => {
assert_eq!(cqueue::more(cqe.flags()), true);
assert!(cqueue::more(cqe.flags()));
}
// Last SendZc notification
0 => {
assert_eq!(cqueue::more(cqe.flags()), false);
assert!(!cqueue::more(cqe.flags()));
}
_ => panic!("wrong result for notification"),
},
Expand Down
5 changes: 2 additions & 3 deletions io-uring-test/src/tests/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,10 @@ pub fn test_msg_ring_data<S: squeue::EntryMarker, C: cqueue::EntryMarker>(
let fd = types::Fd(dest_ring.as_raw_fd());
let result = 82; // b'R'
let user_data = 85; // b'U'
let flags = None;
unsafe {
ring.submission()
.push(
&opcode::MsgRingData::new(fd, result, user_data, flags)
&opcode::MsgRingData::new(fd, result, user_data, None)
.build()
.into(),
)
Expand All @@ -194,7 +193,7 @@ pub fn test_msg_ring_data<S: squeue::EntryMarker, C: cqueue::EntryMarker>(
assert_eq!(dest_cqes.len(), 1);
assert_eq!(dest_cqes[0].user_data(), user_data);
assert_eq!(dest_cqes[0].result(), result);
assert_eq!(dest_cqes[0].flags(), flags.unwrap_or(0));
assert_eq!(dest_cqes[0].flags(), 0);

Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion io-uring-test/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ pub fn writev_readv<S: squeue::EntryMarker, C: cqueue::EntryMarker>(
let mut output = vec![0; text.len()];
let mut output2 = vec![0; text2.len()];

let text3 = vec![IoSlice::new(text), IoSlice::new(text2)];
let text3 = [IoSlice::new(text), IoSlice::new(text2)];
let mut output3 = vec![IoSliceMut::new(&mut output), IoSliceMut::new(&mut output2)];

let write_e = opcode::Writev::new(fd_in, text3.as_ptr().cast(), text3.len() as _);
Expand Down
4 changes: 2 additions & 2 deletions src/cqueue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ impl Entry {
///
/// This is currently used for:
/// - Storing the selected buffer ID, if one was selected. See
/// [`BUFFER_SELECT`](crate::squeue::Flags::BUFFER_SELECT) for more info.
/// [`BUFFER_SELECT`](crate::squeue::Flags::BUFFER_SELECT) for more info.
#[inline]
pub fn flags(&self) -> u32 {
self.0.flags
Expand Down Expand Up @@ -259,7 +259,7 @@ impl Entry32 {
///
/// This is currently used for:
/// - Storing the selected buffer ID, if one was selected. See
/// [`BUFFER_SELECT`](crate::squeue::Flags::BUFFER_SELECT) for more info.
/// [`BUFFER_SELECT`](crate::squeue::Flags::BUFFER_SELECT) for more info.
#[inline]
pub fn flags(&self) -> u32 {
self.0 .0.flags
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//!
//! The crate only provides a summary of the parameters.
//! For more detailed documentation, see manpage.
#![warn(rust_2018_idioms, unused_qualifications)]
#![warn(rust_2018_idioms)]

#[macro_use]
mod util;
Expand Down

0 comments on commit 0a2283a

Please sign in to comment.