[go: up one dir, main page]

mimalloc 0.1.37

Performance and security oriented drop-in allocator
Documentation
name: CI

on:
  push:
  pull_request:
  # Run daily to catch when Rust updates cause problems to happen.
  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@v3
        with:
          submodules: recursive

      - name: Install Rust toolchain
        uses: actions-rs/toolchain@v1
        with:
          toolchain: ${{ matrix.toolchain }}
          profile: minimal
          default: true

      - name: Build (secure)
        uses: actions-rs/cargo@v1
        with:
          command: build

      - name: Test (secure)
        uses: actions-rs/cargo@v1
        with:
          command: test

      - name: Test libmimalloc-sys crate bindings (secure)
        uses: actions-rs/cargo@v1
        with:
          command: run
          args: -p libmimalloc-sys-test

      - name: Build (no secure)
        uses: actions-rs/cargo@v1
        with:
          command: build
          args: --no-default-features

      - name: Test (no secure)
        uses: actions-rs/cargo@v1
        with:
          command: test
          args: --no-default-features

      - name: Test libmimalloc-sys crate bindings (no secure)
        uses: actions-rs/cargo@v1
        with:
          command: run
          args: --no-default-features -p libmimalloc-sys-test

  lint:
    name: Rustfmt / Clippy
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3
        with:
          submodules: recursive

      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          components: rustfmt, clippy

      - name: Fmt
        uses: actions-rs/cargo@v1
        with:
          command: fmt
          args: --all -- --check

      - name: Clippy
        uses: actions-rs/cargo@v1
        with:
          command: clippy
          args: --workspace -- -D warnings

  # Detect cases where documentation links would be dead
  doc:
    name: Check documentation
    runs-on: ubuntu-latest
    steps:

      - uses: actions/checkout@v3
        with:
          submodules: recursive

      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: nightly
          override: true

      # Note: We need to use nightly rust, and `cargo rustdoc` (yes, not `cargo
      # doc`) to actually get it to respect -D warnings... Using nightly also
      # gets us the nicer syntax for linking to functions, and is in-line with
      # what docs.rs uses.

      - name: 'Check documentation links in `mimalloc`'
        uses: actions-rs/cargo@v1
        with:
          command: rustdoc
          args: -- -D warnings

      - name: 'Check documentation links in `libmimalloc-sys`'
        uses: actions-rs/cargo@v1
        with:
          command: rustdoc
          args: -p libmimalloc-sys -- -D warnings