Skip to content

ci: Enable ASan on libjxl #508

ci: Enable ASan on libjxl

ci: Enable ASan on libjxl #508

Workflow file for this run

name: CI
on:
push:
branches: master
pull_request:
env:
RUST_BACKTRACE: 1
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
name: Unit Tests
timeout-minutes: 20
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: macos-13
# rustflags: "-Clink-args=-fapple-link-rtlib"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: Install cargo-nextest
uses: taiki-e/install-action@nextest
- uses: Leafwing-Studios/cargo-cache@v2
with:
sweep-cache: true
- name: Tests
run: cargo nextest run --all-features --workspace
# env:
# RUSTFLAGS: "${{ matrix.rustflags }}"
coverage:
name: Code Coverage
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Rust Nightly
uses: dtolnay/rust-toolchain@nightly
with:
components: llvm-tools
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Install cargo-nextest
uses: taiki-e/install-action@nextest
- uses: Leafwing-Studios/cargo-cache@v2
with:
sweep-cache: true
- 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
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
fail_ci_if_error: true
sanitizers:
name: Sanitizers
strategy:
matrix:
sanitizer: [address, thread]
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Rust Nightly
uses: dtolnay/rust-toolchain@nightly
with:
components: rust-src
- name: Install cargo-nextest
uses: taiki-e/install-action@nextest
- uses: Leafwing-Studios/cargo-cache@v2
with:
sweep-cache: true
- 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}} --cfg=asan"
RUSTDOCFLAGS: "-Zsanitizer=${{matrix.sanitizer}} --cfg=asan"
msrv:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: Leafwing-Studios/cargo-cache@v2
with:
sweep-cache: true
- uses: taiki-e/install-action@cargo-hack
- run: cargo hack check --rust-version --workspace --all-targets --ignore-private --all-features
clippy:
name: Clippy
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Rust
run: rustup update stable
- uses: Leafwing-Studios/cargo-cache@v2
with:
sweep-cache: true
- name: Run Clippy with reviewdog
uses: giraffate/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
clippy_flags: --all-features --tests -- -D warnings
reporter: github-check
fmt:
name: Rustfmt
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: rustup update stable
- name: Format check
run: cargo fmt --all -- --check