darkbio-clock 0.3.1

Virtual clock for testing blocking code
Documentation
name: tests

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

env:
  CARGO_TERM_COLOR: always

jobs:
  loom:
    runs-on: ubuntu-latest
    timeout-minutes: 10 # Stops a model whose schedules grow beyond the budget
    steps:
      - uses: actions/checkout@v7
      - run: make loom

  test:
    name: Test on ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    timeout-minutes: 30 # A broken wakeup hangs a test instead of failing it
    strategy:
      matrix:
        os: [ ubuntu-latest, windows-latest, macOS-latest ]

    steps:
      - uses: actions/checkout@v7

      - name: Build
        run: cargo build --locked --verbose

      - name: Install cargo-hack
        run: cargo install cargo-hack

      - name: Build feature combinations
        run: cargo hack build --feature-powerset --locked

      - name: Test feature combinations
        run: cargo hack test --feature-powerset --locked

  format:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - run: cargo fmt --all -- --check

  clippy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - run: cargo install cargo-hack
      - run: cargo hack clippy --feature-powerset --all-targets --locked -- -D warnings
      - run: make lint

  docs:
    runs-on: ubuntu-latest
    env:
      RUSTDOCFLAGS: -D warnings
    steps:
      - uses: actions/checkout@v7
      - run: cargo doc --all-features --no-deps --locked

  semver:
    name: Semver on ${{ matrix.feature-group }}
    if: github.event_name == 'pull_request'
    runs-on: ubuntu-latest
    strategy:
      matrix:
        feature-group: [ default-features, all-features ]

    steps:
      - uses: actions/checkout@v7

      - name: Check the public API against the published release
        uses: obi1kenobi/cargo-semver-checks-action@v2
        with:
          feature-group: ${{ matrix.feature-group }}