async-deferred 0.3.0

A lightweight utility for spawning async tasks with fire-and-forget semantics and deferred result retrieval.
Documentation
name: CI

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

permissions:
  contents: read

# Cancel a run when a newer commit is pushed to the same branch or pull request.
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

env:
  CARGO_TERM_COLOR: always

jobs:
  test:
    name: Test (${{ matrix.os }})
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
    steps:
      - uses: actions/checkout@v7
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2

      - name: All features
        run: cargo test --all-features

      # Doctests need the default features, so only the test targets run here.
      - name: No default features (no_std)
        run: cargo test --no-default-features --tests

      - name: std only, without a runtime
        run: cargo test --no-default-features --features std --tests

  lint:
    name: Lint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy, rustfmt
      - uses: Swatinem/rust-cache@v2

      - name: Format
        run: cargo fmt --check

      - name: Clippy (all features)
        run: cargo clippy --all-targets --all-features -- -D warnings

      - name: Clippy (no default features)
        run: cargo clippy --all-targets --no-default-features -- -D warnings

      - name: Docs
        run: cargo doc --no-deps --all-features
        env:
          RUSTDOCFLAGS: -D warnings

  no-std:
    name: no_std (${{ matrix.target }})
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        target:
          - riscv32imac-unknown-none-elf # e.g. ESP32-C6
          - thumbv7em-none-eabihf # e.g. STM32F4, nRF52
    steps:
      - uses: actions/checkout@v7
      - uses: dtolnay/rust-toolchain@stable
        with:
          targets: ${{ matrix.target }}
      - uses: Swatinem/rust-cache@v2

      - name: Build
        run: cargo build --no-default-features --target ${{ matrix.target }}