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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Add doc test #124

Merged
merged 1 commit into from
Dec 19, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 18 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,22 @@ 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
# FIXME: Nightly changed the behavior to start from `src` folder
# 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
Loading