vmi 0.6.0

A modular and extensible library for Virtual Machine Introspection
Documentation
name: CI

on:
  push:                       # Allows push to trigger the workflow.
  pull_request:               # Allows PRs to trigger the workflow.
  workflow_dispatch:          # Allows manual triggering of the workflow.

env:
  CARGO_TERM_COLOR: always    # Enable colored output for cargo.
  RUSTFLAGS: -Dwarnings       # Enable all warnings for the Rust compiler.
  XEN_SYS_USE_BINDINGS: 1     # Enable use of Xen bindings in libxen.

permissions:
  contents: read

jobs:
  msrv:
    name: cargo check (MSRV)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: ./.github/actions/setup
        with:
          toolchain: "1.95.0"
      - run: cargo check --workspace --all-features

  doc:
    name: cargo doc
    runs-on: ubuntu-latest
    env:
      RUSTDOCFLAGS: --cfg docsrs -D warnings
    steps:
      - uses: actions/checkout@v4
      - uses: ./.github/actions/setup
        with:
          toolchain: nightly
      - run: cargo +nightly doc --workspace --all-features --no-deps

  clippy:
    name: cargo clippy
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: ./.github/actions/setup
        with:
          components: clippy
      - run: cargo clippy --workspace --all-targets --all-features -- -D warnings

  fmt:
    name: cargo fmt
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: ./.github/actions/setup
        with:
          toolchain: nightly
          components: rustfmt
      - run: cargo +nightly fmt --all -- --check

  #
  # It would be better to run `cargo build --examples` but since the Xen
  # is not installed in the CI environment, the examples will not compile.
  #
  examples:
    name: cargo check --examples
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: ./.github/actions/setup
      - run: cargo check --examples --all-features

  test:
    name: cargo test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: ./.github/actions/setup
      - run: cargo test --workspace --all-features --lib --tests

  doctest:
    name: cargo test --doc
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: ./.github/actions/setup
      - run: cargo test --workspace --all-features --doc

  feature-powerset:
    name: cargo hack --feature-powerset
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: ./.github/actions/setup
      - uses: taiki-e/install-action@cargo-hack
      - run: cargo hack --feature-powerset --workspace check

  semver-checks:
    name: cargo semver-checks
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: obi1kenobi/cargo-semver-checks-action@v2
        with:
          feature-group: all-features

  notify:
    name: Notify parent repo
    runs-on: ubuntu-latest
    if: github.event_name == 'push' && github.ref == 'refs/heads/master'
    needs: [msrv, doc, clippy, fmt, examples, test, doctest, feature-powerset, semver-checks]
    steps:
      - name: Generate token
        id: app-token
        uses: actions/create-github-app-token@v1
        with:
          app-id: ${{ secrets.APP_ID }}
          private-key: ${{ secrets.APP_PRIVATE_KEY }}
          owner: vmi-rs

      - name: Send repository_dispatch to vmi-rs
        uses: peter-evans/repository-dispatch@v3
        with:
          token: ${{ steps.app-token.outputs.token }}
          repository: vmi-rs/vmi-rs
          event-type: vmi-updated
          client-payload: '{"sha": "${{ github.sha }}"}'