thread-priority 3.0.0

Library for managing threads priority and schedule policies
Documentation
name: Nightly Build

on:
  schedule:
    - cron: '0 2 * * *'

env:
  minrust: 1.85

jobs:
  test:
    name: Test
    runs-on: ${{ matrix.os || 'ubuntu-latest' }}

    strategy:
      fail-fast: false
      matrix:
        name:
          - stable
          - beta
          - nightly
          - macOS
          - Windows

        include:
          - name: beta
            toolchain: beta
          - name: nightly
            toolchain: nightly
          - name: macOS
            os: macOS-latest
          - name: Windows
            os: windows-latest

    steps:
      - name: Checkout sources
        uses: actions/checkout@v4

      - name: Install toolchain
        id: tc
        uses: actions-rs/toolchain@v1
        with:
          toolchain: ${{ matrix.toolchain || 'stable' }}
          profile: minimal
          override: true

      - name: Setup cache
        uses: actions/cache@v4
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            target
          key: ${{ runner.os }}-test-${{ steps.tc.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.toml') }}

      - name: Build all features
        if: matrix.features == ''
        run: cargo build --all-features

      - name: Test all features (other)
        if: matrix.features == '' && runner.os != 'Linux'
        run: cargo test --all-features -- --skip set_deadline_policy

      - name: Test all features (Linux)
        if: matrix.features == '' && runner.os == 'Linux'
        run: sudo -E /home/runner/.cargo/bin/cargo test --all-features
#        run: sudo -E /usr/share/rust/.cargo/bin/cargo test --all-features

  rustfmt:
    name: Format
    runs-on: ubuntu-latest

    steps:
      - name: Checkout sources
        uses: actions/checkout@v4

      - name: Install stable toolchain
        uses: actions-rs/toolchain@v1
        with:
          toolchain: nightly
          components: rustfmt
          profile: minimal
          override: true

      - name: Run cargo fmt
        run: cargo fmt --all -- --check

  clippy:
    name: Clippy
    runs-on: ubuntu-latest

    steps:
      - name: Checkout sources
        uses: actions/checkout@v4

      - name: Install toolchain
        id: tc
        uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          profile: minimal
          override: true

      - name: Setup cache
        uses: actions/cache@v4
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            target
          key: ${{ runner.os }}-clippy-${{ steps.tc.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.toml') }}

      - run: cargo clippy

  MSRV:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout sources
        uses: actions/checkout@v4

      - name: Install toolchain (${{ env.minrust }})
        id: tc
        uses: actions-rs/toolchain@v1
        with:
          toolchain: ${{ env.minrust }}
          profile: minimal
          override: true

      - name: Setup cache
        uses: actions/cache@v4
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            target
          key: ${{ runner.os }}-msrv-${{ steps.tc.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.toml') }}

      - run: cargo check --all-features

  doc:
    name: Build docs
    runs-on: ubuntu-latest

    steps:
      - name: Checkout sources
        uses: actions/checkout@v4

      - name: Install toolchain
        id: tc
        uses: actions-rs/toolchain@v1
        with:
          toolchain: nightly
          profile: minimal
          override: true

      - name: Setup cache
        uses: actions/cache@v4
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
          key: ${{ runner.os }}-docs-${{ steps.tc.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.toml') }}

      - name: Build docs
        run: |
          cargo doc