Merge pull request #92 from zip-rs/docs-check-feature-flag
ci: Run cargo doc and clippy with default features, all features and no features
This commit is contained in:
commit
00d8cadba3
2 changed files with 42 additions and 10 deletions
41
.github/workflows/ci.yaml
vendored
41
.github/workflows/ci.yaml
vendored
|
@ -52,33 +52,51 @@ jobs:
|
||||||
command: test
|
command: test
|
||||||
args: --all ${{ matrix.feature_flag }}
|
args: --all ${{ matrix.feature_flag }}
|
||||||
|
|
||||||
style_and_docs:
|
cargo_fmt:
|
||||||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
|
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: actions-rs/toolchain@v1
|
- uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
profile: minimal
|
profile: minimal
|
||||||
toolchain: nightly
|
toolchain: nightly
|
||||||
override: true
|
override: true
|
||||||
components: rustfmt, clippy
|
components: rustfmt
|
||||||
- name: fmt
|
- name: fmt
|
||||||
run: cargo fmt --all -- --check
|
run: cargo fmt --all -- --check
|
||||||
- name: clippy
|
|
||||||
uses: actions-rs/cargo@v1
|
style_and_docs:
|
||||||
with:
|
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
|
||||||
command: clippy
|
strategy:
|
||||||
args: --all-targets --all-features -- -D warnings
|
matrix:
|
||||||
- name: Docs
|
feature_flag: ["--all-features", "--no-default-features", ""]
|
||||||
run: cargo doc --no-deps
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
profile: minimal
|
||||||
|
toolchain: nightly
|
||||||
|
override: true
|
||||||
|
components: clippy
|
||||||
|
- name: clippy
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: clippy
|
||||||
|
args: --all-targets ${{ matrix.feature_flag }} -- -D warnings
|
||||||
|
- name: docs
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: doc
|
||||||
|
args: --no-deps ${{ matrix.feature_flag }}
|
||||||
|
|
||||||
fuzz_read:
|
fuzz_read:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs:
|
needs:
|
||||||
- build_and_test
|
- build_and_test
|
||||||
|
- cargo_fmt
|
||||||
- style_and_docs
|
- style_and_docs
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
@ -126,6 +144,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs:
|
needs:
|
||||||
- build_and_test
|
- build_and_test
|
||||||
|
- cargo_fmt
|
||||||
- style_and_docs
|
- style_and_docs
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
@ -173,6 +192,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs:
|
needs:
|
||||||
- build_and_test
|
- build_and_test
|
||||||
|
- cargo_fmt
|
||||||
- style_and_docs
|
- style_and_docs
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
@ -220,6 +240,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs:
|
needs:
|
||||||
- build_and_test
|
- build_and_test
|
||||||
|
- cargo_fmt
|
||||||
- style_and_docs
|
- style_and_docs
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
|
@ -65,6 +65,7 @@ fn merge_archive_stored(bench: &mut Bencher) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "_deflate-any")]
|
||||||
fn merge_archive_compressed(bench: &mut Bencher) {
|
fn merge_archive_compressed(bench: &mut Bencher) {
|
||||||
let options = SimpleFileOptions::default().compression_method(zip::CompressionMethod::Deflated);
|
let options = SimpleFileOptions::default().compression_method(zip::CompressionMethod::Deflated);
|
||||||
let (len, src) = generate_random_archive(NUM_ENTRIES, ENTRY_SIZE, options).unwrap();
|
let (len, src) = generate_random_archive(NUM_ENTRIES, ENTRY_SIZE, options).unwrap();
|
||||||
|
@ -95,6 +96,7 @@ fn merge_archive_raw_copy_file_stored(bench: &mut Bencher) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "_deflate-any")]
|
||||||
fn merge_archive_raw_copy_file_compressed(bench: &mut Bencher) {
|
fn merge_archive_raw_copy_file_compressed(bench: &mut Bencher) {
|
||||||
let options = SimpleFileOptions::default().compression_method(zip::CompressionMethod::Deflated);
|
let options = SimpleFileOptions::default().compression_method(zip::CompressionMethod::Deflated);
|
||||||
let (len, src) = generate_random_archive(NUM_ENTRIES, ENTRY_SIZE, options).unwrap();
|
let (len, src) = generate_random_archive(NUM_ENTRIES, ENTRY_SIZE, options).unwrap();
|
||||||
|
@ -110,6 +112,7 @@ fn merge_archive_raw_copy_file_compressed(bench: &mut Bencher) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "_deflate-any")]
|
||||||
benchmark_group!(
|
benchmark_group!(
|
||||||
benches,
|
benches,
|
||||||
merge_archive_stored,
|
merge_archive_stored,
|
||||||
|
@ -117,4 +120,12 @@ benchmark_group!(
|
||||||
merge_archive_raw_copy_file_stored,
|
merge_archive_raw_copy_file_stored,
|
||||||
merge_archive_raw_copy_file_compressed,
|
merge_archive_raw_copy_file_compressed,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
#[cfg(not(feature = "_deflate-any"))]
|
||||||
|
benchmark_group!(
|
||||||
|
benches,
|
||||||
|
merge_archive_stored,
|
||||||
|
merge_archive_raw_copy_file_stored,
|
||||||
|
);
|
||||||
|
|
||||||
benchmark_main!(benches);
|
benchmark_main!(benches);
|
||||||
|
|
Loading…
Add table
Reference in a new issue