isr 0.5.0

Intermediate Symbol Representation
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.91.0"
      - run: cargo check --workspace --all-features

  doc:
    name: cargo doc
    runs-on: ubuntu-latest
    env:
      RUSTDOCFLAGS: -D warnings
    steps:
      - uses: actions/checkout@v4
      - uses: ./.github/actions/setup
      - run: cargo 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

  examples:
    name: cargo build --examples
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: ./.github/actions/setup
      - run: cargo build --examples

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

  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: isr-updated
          client-payload: '{"sha": "${{ github.sha }}"}'