lite-sync 0.3.0

Fast, lightweight async primitives: SPSC channel, oneshot, notify, and atomic waker
Documentation
name: CI

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

jobs:
  generate-matrix:
    name: Generate Feature Matrix
    runs-on: ubuntu-latest
    outputs:
      features: ${{ steps.set-matrix.outputs.features }}
    steps:
      - name: Checkout sources
        uses: actions/checkout@main

      - name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@stable

      - name: Install cargo-hack
        uses: taiki-e/install-action@cargo-hack

      - name: Generate feature combinations
        id: set-matrix
        run: |
          # Get list of cargo test commands from cargo hack
          COMMANDS=$(cargo hack test --feature-powerset --print-command-list)
          
          # Extract the arguments after "cargo test --manifest-path Cargo.toml " and format as JSON array
          JSON=$(echo "$COMMANDS" | sed 's/cargo test --manifest-path Cargo.toml //g' | jq -R -s -c 'split("\n") | map(select(length > 0))')
          echo "features=$JSON" >> $GITHUB_OUTPUT

  test:
    name: Test (${{ matrix.features }})
    needs: generate-matrix
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        features: ${{ fromJson(needs.generate-matrix.outputs.features) }}
    steps:
      - name: Checkout sources
        uses: actions/checkout@main

      - name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@stable

      - name: Run cargo test
        run: cargo test ${{ matrix.features }}