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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean-up CI config #417

Merged
merged 2 commits into from Jun 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 19 additions & 9 deletions .github/workflows/main.yml
Expand Up @@ -21,7 +21,10 @@ jobs:
- 1.56.0 # MSRV
- stable
- nightly
os: [ubuntu-latest, macos-latest, windows-latest]
os:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}

steps:
Expand All @@ -35,19 +38,27 @@ jobs:
rustup override set ${{ matrix.version }}

- name: check build
if: matrix.version != 'stable' && matrix.os == 'macos-latest'
if: matrix.version != '1.56.0' && matrix.os == 'macos-latest'
run: cargo check --features=serde,macos_kqueue --examples

- name: check build
if: matrix.version != 'stable' && matrix.os != 'macos-latest'
if: matrix.version == '1.56.0' && matrix.os == 'macos-latest'
run: cargo check --features=serde,macos_kqueue

- name: check build
if: matrix.version != '1.56.0' && matrix.os != 'macos-latest'
run: cargo check --features=serde --examples

- name: check build
if: matrix.version == '1.56.0' && matrix.os != 'macos-latest'
run: cargo check --features=serde

- name: check build example
if: matrix.version != 'stable'
if: matrix.version == 'stable'
run: cargo check -p watcher_kind

- name: test hot_reload_tide
if: matrix.version != 'stable'
if: matrix.version == 'stable'
run: cargo test -p hot_reload_tide

- name: test
Expand All @@ -61,7 +72,6 @@ jobs:
target:
- x86_64-unknown-netbsd
- x86_64-unknown-freebsd
- x86_64-apple-darwin
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@0xpr03 Removed x86_64-apple-darwin as we've already tested code with macOS on the above ci workflow. I think it should be fine but would like to mention it, just in case.

runs-on: ubuntu-latest

steps:
Expand All @@ -72,12 +82,12 @@ jobs:
run: |
rustup set profile minimal
rustup toolchain install stable --no-self-update
rustup target add ${{ matrix.target}}
rustup target add ${{ matrix.target }}

- name: check build
run: |
rustc --version && cargo --version
cargo build --target ${{ matrix.target}}
rustc --version && cargo --version
cargo build --target ${{ matrix.target }}

audit:
runs-on: ubuntu-latest
Expand Down
16 changes: 9 additions & 7 deletions src/poll.rs
Expand Up @@ -53,7 +53,7 @@ mod data {
{
Self {
emitter: EventEmitter::new(event_handler),
build_hasher: compare_content.then(|| RandomState::default()),
build_hasher: compare_content.then(RandomState::default),
now: Instant::now(),
}
}
Expand Down Expand Up @@ -187,11 +187,11 @@ mod data {
/// # Side Effect
///
/// This function may emit some IO Error events by `data_builder.emitter`.
fn scan_all_path_data<'a>(
data_builder: &'a DataBuilder,
fn scan_all_path_data(
data_builder: &'_ DataBuilder,
root: PathBuf,
is_recursive: bool,
) -> impl Iterator<Item = (PathBuf, PathData)> + 'a {
) -> impl Iterator<Item = (PathBuf, PathData)> + '_ {
// WalkDir return only one entry if root is a file (not a folder),
// so we can use single logic to do the both file & dir's jobs.
//
Expand Down Expand Up @@ -263,7 +263,7 @@ mod data {
let metadata = meta_path.metadata();

PathData {
mtime: FileTime::from_last_modification_time(&metadata).seconds(),
mtime: FileTime::from_last_modification_time(metadata).seconds(),
hash: data_builder
.build_hasher
.as_ref()
Expand Down Expand Up @@ -470,7 +470,9 @@ impl PollWatcher {
{
data_builder.update_timestamp();

for watch_data in watches.values_mut() {

let vals = watches.values_mut();
for watch_data in vals {
watch_data.rescan(&mut data_builder);
}
}
Expand Down Expand Up @@ -523,7 +525,7 @@ impl PollWatcher {
.unwrap()
.remove(path)
.map(|_| ())
.ok_or_else(|| crate::Error::watch_not_found())
.ok_or_else(crate::Error::watch_not_found)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm yeah should've watched out for that, probably let clippy do its thing

}
}

Expand Down