name: CI
on:
push:
pull_request:
schedule:
- cron: "00 01 * * *"
jobs:
rust:
name: Rust
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
toolchain: ["stable"]
runs-on: ${{ matrix.os }}
env:
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: 1
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- name: Build (secure)
run: cargo build --features secure
- name: Test (secure)
run: cargo test --features secure
- name: Test libmimalloc-sys crate bindings (secure)
run: cargo run --features libmimalloc-sys-test/secure -p libmimalloc-sys-test
- name: Build (no secure)
run: cargo build
- name: Test (no secure)
run: cargo test
- name: Test libmimalloc-sys crate bindings (no secure)
run: cargo run -p libmimalloc-sys-test
- name: Build (extended)
run: cargo build --features extended
- name: Test (extended)
run: cargo test --features extended
- name: Test libmimalloc-sys crate bindings (extended)
run: cargo run --features libmimalloc-sys-test/extended -p libmimalloc-sys-test
- name: Build (v2, secure)
run: cargo build --features v2,secure
- name: Test (v2, secure)
run: cargo test --features v2,secure
- name: Test libmimalloc-sys crate bindings (v2, secure)
run: cargo run --features libmimalloc-sys-test/v2,libmimalloc-sys-test/secure -p libmimalloc-sys-test
- name: Build (v2, no secure)
run: cargo build --features v2
- name: Test (v2, no secure)
run: cargo test --features v2
- name: Test libmimalloc-sys crate bindings (v2, no secure)
run: cargo run --features libmimalloc-sys-test/v2 -p libmimalloc-sys-test
- name: Build (v2, extended)
run: cargo build --features v2,extended
- name: Test (v2, extended)
run: cargo test --features v2,extended
- name: Test libmimalloc-sys crate bindings (v2, extended)
run: cargo run --features libmimalloc-sys-test/v2,libmimalloc-sys-test/extended -p libmimalloc-sys-test
- name: Test override dylib
if: ${{ !contains(matrix.os, 'windows') }}
run: cargo run -ptest-override-with-dylib --features override
lint:
name: Rustfmt / Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Fmt
run: cargo fmt --all -- --check
doc:
name: Check documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: dtolnay/rust-toolchain@nightly
- name: "Check documentation links in `mimalloc`"
run: cargo rustdoc -- -D warnings
- name: "Check documentation links in `libmimalloc-sys`"
run: cargo rustdoc -p libmimalloc-sys -- -D warnings