Skip to content

Commit 3e8f334

Browse files
authored
test: run CI on both linux and macos (#318)
* test: run CI on both linux and macos Signed-off-by: MrCroxx <[email protected]> * fix: fix build on macos Signed-off-by: MrCroxx <[email protected]> * fix: try fix ci run on targets Signed-off-by: MrCroxx <[email protected]> --------- Signed-off-by: MrCroxx <[email protected]>
1 parent e423dc4 commit 3e8f334

File tree

6 files changed

+22
-8
lines changed

6 files changed

+22
-8
lines changed

.github/template/template.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ jobs:
3636
uses: ludeeus/action-shellcheck@master
3737
rust-test:
3838
name: rust test with codecov
39-
runs-on: ubuntu-latest
39+
runs-on: ${{ matrix.os }}
40+
strategy:
41+
matrix:
42+
os: [ubuntu-latest, macos-latest]
4043
steps:
4144
- name: Checkout
4245
uses: actions/checkout@v3

.github/workflows/main.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ jobs:
4343
uses: ludeeus/action-shellcheck@master
4444
rust-test:
4545
name: rust test with codecov
46-
runs-on: ubuntu-latest
46+
runs-on: ${{ matrix.os }}
47+
strategy:
48+
matrix:
49+
os: [ubuntu-latest, macos-latest]
4750
steps:
4851
- name: Checkout
4952
uses: actions/checkout@v3

.github/workflows/pull-request.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ jobs:
4242
uses: ludeeus/action-shellcheck@master
4343
rust-test:
4444
name: rust test with codecov
45-
runs-on: ubuntu-latest
45+
runs-on: ${{ matrix.os }}
46+
strategy:
47+
matrix:
48+
os: [ubuntu-latest, macos-latest]
4649
steps:
4750
- name: Checkout
4851
uses: actions/checkout@v3

foyer-experimental-bench/src/utils.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ use std::path::{Path, PathBuf};
3131
use itertools::Itertools;
3232
use nix::{fcntl::readlink, sys::stat::stat};
3333

34-
#[cfg_attr(not(target_os = "linux"), expect(dead_code))]
34+
// TODO(MrCroxx): use `expect` after `lint_reasons` is stable.
35+
#[cfg_attr(not(target_os = "linux"), allow(dead_code))]
3536
#[derive(PartialEq, Clone, Copy, Debug)]
3637
pub enum FsType {
3738
Xfs,
@@ -41,7 +42,8 @@ pub enum FsType {
4142
Others,
4243
}
4344

44-
#[cfg_attr(not(target_os = "linux"), expect(unused_variables))]
45+
// TODO(MrCroxx): use `expect` after `lint_reasons` is stable.
46+
#[cfg_attr(not(target_os = "linux"), allow(unused_variables))]
4547
pub fn detect_fs_type(path: impl AsRef<Path>) -> FsType {
4648
#[cfg(target_os = "linux")]
4749
{

foyer-storage-bench/src/utils.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ use std::path::{Path, PathBuf};
3131
use itertools::Itertools;
3232
use nix::{fcntl::readlink, sys::stat::stat};
3333

34-
#[cfg_attr(not(target_os = "linux"), expect(dead_code))]
34+
// TODO(MrCroxx): use `expect` after `lint_reasons` is stable.
35+
#[cfg_attr(not(target_os = "linux"), allow(dead_code))]
3536
#[derive(PartialEq, Clone, Copy, Debug)]
3637
pub enum FsType {
3738
Xfs,
@@ -41,7 +42,8 @@ pub enum FsType {
4142
Others,
4243
}
4344

44-
#[cfg_attr(not(target_os = "linux"), expect(unused_variables))]
45+
// TODO(MrCroxx): use `expect` after `lint_reasons` is stable.
46+
#[cfg_attr(not(target_os = "linux"), allow(unused_variables))]
4547
pub fn detect_fs_type(path: impl AsRef<Path>) -> FsType {
4648
#[cfg(target_os = "linux")]
4749
{

foyer-storage/src/device/fs.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ impl FsDeviceConfig {
6262
struct FsDeviceInner {
6363
config: FsDeviceConfig,
6464

65-
#[cfg_attr(not(target_os = "linux"), expect(dead_code))]
65+
// TODO(MrCroxx): use `expect` after `lint_reasons` is stable.
66+
#[cfg_attr(not(target_os = "linux"), allow(dead_code))]
6667
dir: File,
6768

6869
files: Vec<File>,

0 commit comments

Comments
 (0)