virtual-buffer 2.0.0

A cross-platform library for dealing with buffers backed by raw virtual memory
Documentation
name: CI

on:
  push:
    paths-ignore:
      - '**.md'
  pull_request:
    paths-ignore:
      - '**.md'

jobs:
  build:
    strategy:
      matrix:
        include:
          - name: windows-latest
            runs-on: [self-hosted, Windows]
            self-hosted: true
            shell: wsl -e wsl-bash {0}
            target: x86_64-pc-windows-msvc
            target-dir: ~/.cargo/target
          - name: ubuntu-latest
            runs-on: ubuntu-latest
            self-hosted: false
            shell: bash
            target: x86_64-unknown-linux-gnu
            target-dir: target
          - name: macos-latest
            runs-on: macos-latest
            self-hosted: false
            shell: bash
            target: aarch64-apple-darwin
            target-dir: target
      fail-fast: false
    name: build / ${{ matrix.name }}
    runs-on: ${{ matrix.runs-on }}
    defaults:
      run:
        shell: ${{ matrix.shell }}
    env:
      common_args: >-
        --target ${{ matrix.target }}
        --target-dir ${{ matrix.target-dir }}
        --color always
        --verbose
    steps:
      - uses: actions/checkout@v6
      - uses: cachix/install-nix-action@v31
        if: ${{ ! matrix.self-hosted }}
      - uses: Swatinem/rust-cache@151eeee51b94b648db7d5aa68ce6a3cad1ddea4e
        if: ${{ ! matrix.self-hosted }}
        with:
          cache-bin: false
          cmd-format: nix develop .#ci -c {0}
      - name: Run clippy
        run: nix develop .#ci -c cargo clippy ${{ env.common_args }} -- -Dwarnings
      - name: Build tests
        run: nix develop .#ci -c cargo build ${{ env.common_args }} --tests
      - name: Run tests
        run: nix develop .#ci -c cargo test ${{ env.common_args }}
  msrv:
    strategy:
      matrix:
        include:
          - name: windows-latest
            runs-on: [self-hosted, Windows]
            self-hosted: true
            shell: wsl -e wsl-bash {0}
            target: x86_64-pc-windows-msvc
            target-dir: ~/.cargo/target-msrv
          - name: ubuntu-latest
            runs-on: ubuntu-latest
            self-hosted: false
            shell: bash
            target: x86_64-unknown-linux-gnu
            target-dir: target
          - name: macos-latest
            runs-on: macos-latest
            self-hosted: false
            shell: bash
            target: aarch64-apple-darwin
            target-dir: target
      fail-fast: false
    name: msrv / ${{ matrix.name }}
    runs-on: ${{ matrix.runs-on }}
    defaults:
      run:
        shell: ${{ matrix.shell }}
    env:
      common_args: >-
        --target ${{ matrix.target }}
        --target-dir ${{ matrix.target-dir }}
        --color always
        --verbose
    steps:
      - uses: actions/checkout@v6
      - uses: cachix/install-nix-action@v31
        if: ${{ ! matrix.self-hosted }}
      - uses: Swatinem/rust-cache@151eeee51b94b648db7d5aa68ce6a3cad1ddea4e
        if: ${{ ! matrix.self-hosted }}
        with:
          cache-bin: false
          cmd-format: nix develop .#ci-msrv -c {0}
      - name: Build libraries
        run: nix develop .#ci-msrv -c cargo build ${{ env.common_args }} --lib
  miri:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: cachix/install-nix-action@v31
      - name: Run tests with Miri
        run: nix develop .#nightly -c cargo miri test --color always
  thread_sanitizer:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: cachix/install-nix-action@v31
      - name: Run tests with Thread Sanitizer
        run: nix develop .#nightly -s RUSTFLAGS "-Zsanitizer=thread" -c cargo test -Zbuild-std --target x86_64-unknown-linux-gnu --color always --tests
  fmt:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: cachix/install-nix-action@v31
      - name: Run fmt check
        run: nix develop .#ci -c cargo fmt --check
  typos:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: cachix/install-nix-action@v31
      - name: Run typos
        run: nix develop .#ci -c typos