Skip to content

Commit

Permalink
ci: Enable branch coverage
Browse files Browse the repository at this point in the history
- ci: Remove MSan
  • Loading branch information
inflation committed Nov 29, 2024
1 parent 18f8ac7 commit 71a9535
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 27 deletions.
25 changes: 4 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ jobs:
id: cache
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }}
- name: Tests
Expand Down Expand Up @@ -69,14 +66,12 @@ jobs:
id: cache
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-cov-${{ hashFiles('**/Cargo.lock') }}
- name: Generate code coverage
run: cargo +nightly llvm-cov nextest
--all-features --workspace
--branch
--ignore-filename-regex jpegxl-sys/
--lcov --output-path lcov.info
- name: Upload coverage to Codecov
Expand All @@ -91,9 +86,6 @@ jobs:
strategy:
matrix:
sanitizer: [address, thread]
include:
- sanitizer: memory
rustflags: "-Zsanitizer-memory-track-origins"
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
Expand All @@ -112,17 +104,14 @@ jobs:
id: cache
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-sanitizer-${{ hashFiles('**/Cargo.lock') }}
- name: Address Sanitizer
- name: Test with Sanitizer
run: cargo +nightly nextest run
-Z build-std --target=x86_64-unknown-linux-gnu --all-features
env:
RUSTFLAGS: "-Zsanitizer=${{matrix.sanitizer}} ${{matrix.rustflags}}"
RUSTDOCFLAGS: "-Zsanitizer=${{matrix.sanitizer}} ${{matrix.rustflags}}"
RUSTFLAGS: "-Zsanitizer=${{matrix.sanitizer}}"
RUSTDOCFLAGS: "-Zsanitizer=${{matrix.sanitizer}}"

msrv:
runs-on: ubuntu-latest
Expand All @@ -136,9 +125,6 @@ jobs:
id: cache
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-msrv-${{ hashFiles('**/Cargo.lock') }}
- uses: taiki-e/install-action@cargo-hack
Expand All @@ -160,9 +146,6 @@ jobs:
id: cache
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.lock') }}
- name: Run Clippy with reviewdog
Expand Down
4 changes: 2 additions & 2 deletions jpegxl-rs/src/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ impl<'pr, 'mm> JxlDecoderBuilder<'pr, 'mm> {
}
}

impl<'pr, 'mm> JxlDecoder<'pr, 'mm> {
impl JxlDecoder<'_, '_> {
pub(crate) fn decode_internal(
&self,
data: &[u8],
Expand Down Expand Up @@ -495,7 +495,7 @@ impl<'pr, 'mm> JxlDecoder<'pr, 'mm> {
}
}

impl<'prl, 'mm> Drop for JxlDecoder<'prl, 'mm> {
impl Drop for JxlDecoder<'_, '_> {
fn drop(&mut self) {
unsafe { JxlDecoderDestroy(self.ptr) };
}
Expand Down
4 changes: 2 additions & 2 deletions jpegxl-rs/src/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ impl JxlEncoder<'_, '_> {
})
}

fn _internal(&mut self) -> Result<Vec<u8>, EncodeError> {
fn internal(&mut self) -> Result<Vec<u8>, EncodeError> {
unsafe { JxlEncoderCloseInput(self.enc) };

let mut buffer = vec![0; self.init_buffer_size];
Expand Down Expand Up @@ -351,7 +351,7 @@ impl JxlEncoder<'_, '_> {
// Start encoding
fn start_encoding<U: PixelType>(&mut self) -> Result<EncoderResult<U>, EncodeError> {
Ok(EncoderResult {
data: self._internal()?,
data: self.internal()?,
_pixel_type: PhantomData,
})
}
Expand Down
2 changes: 1 addition & 1 deletion jpegxl-rs/src/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub trait ToDynamic {
) -> Result<Option<DynamicImage>, DecodeError>;
}

impl<'pr, 'mm> ToDynamic for JxlDecoder<'pr, 'mm> {
impl ToDynamic for JxlDecoder<'_, '_> {
fn decode_to_image(&self, data: &[u8]) -> Result<Option<DynamicImage>, DecodeError> {
let mut buffer = vec![];
let mut pixel_format = MaybeUninit::uninit();
Expand Down
1 change: 0 additions & 1 deletion jpegxl-rs/src/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
use jpegxl_sys::common::memory_manager::{JpegxlAllocFunc, JpegxlFreeFunc, JxlMemoryManager};

/// General trait for a memory manager
#[allow(clippy::module_name_repetitions)]
pub trait MemoryManager {
/// Return a custom allocating function
Expand Down

0 comments on commit 71a9535

Please sign in to comment.