name: Tests
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
inputs:
stress_count:
description: 'Number of times to run stress tests'
required: false
default: '10'
jobs:
test:
name: cargo-test ...
runs-on: ubuntu-latest
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
RUST_LOG: trace
STRESS_COUNT: ${{ github.event.inputs.stress_count || 1 }}
strategy:
fail-fast: false
matrix:
rust: [stable, beta, nightly]
runtimes: ["tokio_runtime", "async_runtime", "async_runtime,tokio"]
channels: [async_channel, futures_channel] steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@nextest
- name: workspace
run: cargo nextest run --profile ci --workspace --all-targets --stress-count $STRESS_COUNT
- name: test (most)
run: cargo nextest run --profile ci --workspace --all-targets --no-default-features --features ${{matrix.runtimes}},${{matrix.channels}} --stress-count $STRESS_COUNT
- name: lib test ${{matrix.runtimes}},${{matrix.channels}}
run: cargo nextest run --profile ci --workspace --lib --no-default-features --features ${{matrix.runtimes}},${{matrix.channels}} --stress-count $STRESS_COUNT
- name: doc test (default)
run: cargo test --doc --workspace
- name: doc test ${{matrix.runtimes}},${{matrix.channels}}
run: cargo test --doc --workspace --no-default-features --features ${{matrix.runtimes}},${{matrix.channels}}