Skip to content

Commit

Permalink
ci: Add doc test
Browse files Browse the repository at this point in the history
- Simplify sanitizer ci settings
  • Loading branch information
inflation committed Dec 19, 2024
1 parent ad4542f commit 3603940
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
27 changes: 17 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ jobs:
with:
sweep-cache: true
- name: Tests
run: cargo nextest run --all-features --workspace
run: |
cargo nextest run --all-features --workspace
cargo test --doc --all-features --workspace
coverage:
name: Code Coverage
Expand Down Expand Up @@ -70,11 +72,7 @@ jobs:
name: Sanitizers
strategy:
matrix:
include:
- sanitizer: address
cfg: asan
- sanitizer: thread
cfg: tsan
sanitizer: [address, thread]
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
Expand All @@ -90,12 +88,21 @@ jobs:
- uses: Leafwing-Studios/[email protected]
with:
sweep-cache: true
- name: Setup Sanitizer
id: setup
run: |
if [ ${{ matrix.sanitizer }} == "address" ]; then
echo "CFG=asan" >> "$GITHUB_OUTPUT"
elif [ ${{ matrix.sanitizer }} == "thread" ]; then
echo "CFG=tsan" >> "$GITHUB_OUTPUT"
fi
- name: Test with Sanitizer
run: cargo +nightly nextest run
-Z build-std --target=x86_64-unknown-linux-gnu --all-features
run: |
cargo +nightly nextest run -Z build-std --target=x86_64-unknown-linux-gnu --all-features
cargo +nightly test --doc -Z build-std --target=x86_64-unknown-linux-gnu --all-features
env:
RUSTFLAGS: "-Zsanitizer=${{matrix.sanitizer}} --cfg=${{matrix.cfg}}"
RUSTDOCFLAGS: "-Zsanitizer=${{matrix.sanitizer}} --cfg=${{matrix.cfg}}"
RUSTFLAGS: "-Zsanitizer=${{ matrix.sanitizer }} --cfg=${{ steps.setup.outputs.CFG }}"
RUSTDOCFLAGS: "-Zsanitizer=${{ matrix.sanitizer }} --cfg=${{ steps.setup.outputs.CFG }}"

msrv:
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions jpegxl-rs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use jpegxl_rs::*;
use jpegxl_rs::decode::*;

let mut decoder = decoder_builder().build().unwrap();
let sample = include_bytes!("../../samples/sample.jxl");
let sample = include_bytes!("../samples/sample.jxl");

let (Metadata { width, height, ..}, pixels) = decoder.decode(sample).unwrap();
match pixels {
Expand Down Expand Up @@ -98,7 +98,7 @@ let mut encoder = encoder_builder()
.unwrap();

// You can change the settings after initialization
encoder.lossless = false;
encoder.lossless = Some(false);
encoder.quality = 3.0;
```

Expand Down

0 comments on commit 3603940

Please sign in to comment.