reducer 2.1.1

A predictable reactive framework for Rust apps
Documentation
name: CI

on:
  push:
    branches:
    - master
  pull_request:
    branches:
    - master
  schedule:
  - cron:  '0 6 * * SAT'

jobs:
  fmt:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - uses: hecrj/setup-rust-action@master
      with:
        rust-version: stable
        components: rustfmt
    - run: cargo +stable fmt --all -- --check

  clippy:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - uses: hecrj/setup-rust-action@master
      with:
        rust-version: stable
        components: clippy
    - run: sudo -E apt-get -yq install libgtk-3-dev
    - run: cargo +stable clippy --workspace -- -D warnings

  audit:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - uses: hecrj/setup-rust-action@master
      with:
        rust-version: stable
    - run: cargo +stable install cargo-audit
    - run: cargo +stable audit -D

  doc:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - uses: hecrj/setup-rust-action@master
      with:
        rust-version: nightly
    - run: cargo +nightly doc --all-features

  sanitize:
    needs: [fmt, clippy, audit, doc]
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        sanitizer: [address, leak]
    steps:
    - uses: actions/checkout@master
    - uses: hecrj/setup-rust-action@master
      with:
        rust-version: nightly
    - run: RUSTFLAGS="-Z sanitizer=${{ matrix.sanitizer }}" cargo +nightly test --tests --lib --all-features --target x86_64-unknown-linux-gnu

  coverage:
    needs: sanitize
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - uses: hecrj/setup-rust-action@master
      with:
        rust-version: nightly
    - run: cargo +nightly install cargo-tarpaulin
    - run: for i in 0 1 2; do cargo +nightly tarpaulin --all-features --out Xml && break; done
    - run: bash <(curl -s https://codecov.io/bash) -C $GITHUB_SHA -B ${GITHUB_REF#refs/heads/} -Z
      env:
        CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

  test:
    needs: sanitize
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, windows-latest, macOS-latest]
        rust: [stable, nightly]
    steps:
    - uses: actions/checkout@master
    - uses: hecrj/setup-rust-action@master
      with:
        rust-version: ${{ matrix.rust }}
    - run: cargo +${{ matrix.rust }} test
    - run: cargo +${{ matrix.rust }} test --no-default-features
    - run: cargo +${{ matrix.rust }} test --no-default-features --features alloc
    - run: cargo +${{ matrix.rust }} test --no-default-features --features std
    - run: cargo +${{ matrix.rust }} test --no-default-features --features async
    - run: cargo +${{ matrix.rust }} test --no-default-features --features deprecated

  benchmark:
    needs: sanitize
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - uses: hecrj/setup-rust-action@master
      with:
        rust-version: stable
    - run: cargo +stable bench --all-features

  examples:
    needs: sanitize
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, windows-latest, macOS-latest]
    steps:
    - uses: actions/checkout@master
    - uses: hecrj/setup-rust-action@master
      with:
        rust-version: stable
    - run: sudo -E apt-get -yq install libgtk-3-dev
      if: matrix.os == 'ubuntu-latest'
    - run: cargo +stable build -p examples --release
      if: matrix.os != 'macOS-latest'
    - run: cargo +stable build -p examples --release
      if: matrix.os == 'macOS-latest'
      env:
        CXXFLAGS: '-stdlib=libc++'