virtio-spec 0.4.0

Definitions from the Virtual I/O Device (VIRTIO) specification.
Documentation
name: CI

on:
  push:
  pull_request:
  merge_group:

env:
  CARGO_BUILD_WARNINGS: deny

jobs:
  check:
    name: Check
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: dtolnay/rust-toolchain@stable
      - uses: taiki-e/install-action@cargo-hack
      - run: cargo hack check --feature-powerset --exclude-features nightly --no-dev-deps

  clippy:
    name: Clippy
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: dtolnay/rust-toolchain@stable
      - run: cargo clippy --features alloc,mmio,pci,zerocopy

  doc:
    name: Doc
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: dtolnay/rust-toolchain@stable
      - run: cargo doc --features alloc,mmio,pci,zerocopy

  fmt:
    name: Format
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: dtolnay/rust-toolchain@nightly
        with:
          components: rustfmt
      - run: cargo fmt --all --check

  miri:
    name: Miri
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: dtolnay/rust-toolchain@nightly
        with:
          components: miri
      - run: cargo miri setup
        env:
          # FIXME: Remove once Miri's sysroot does not throw warnings anymore
          CARGO_BUILD_WARNINGS: warn
      - run: cargo miri test --features alloc,mmio,pci,zerocopy
      - run: cargo miri test --all-features
        env:
          # FIXME: Remove once we have removed allocator-api2 when allocator-api is stable.
          # Until then, we have an unavoidable `cargo::unused_dependencies` warning when we enable the nightly feature.
          CARGO_BUILD_WARNINGS: warn

  semver-checks:
    name: Semver checks
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: obi1kenobi/cargo-semver-checks-action@v2

  test:
    name: Test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: dtolnay/rust-toolchain@stable
      - run: cargo test --features alloc,mmio,pci,zerocopy