name: CI

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]
  schedule:
  - cron: '0 0 * * *'

env:
  CARGO_TERM_COLOR: always

jobs:
  main:
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, windows-latest]
        rust: ["1.91", stable, beta, nightly]
    runs-on: ${{ matrix.os }}
    steps:
    - uses: actions-rs/toolchain@v1
      with:
        toolchain: ${{ matrix.rust }}
        override: true
    - run: "rustup component add clippy"
    - uses: actions/checkout@v2
    - run: "cargo build --verbose"
    - run: "cargo test --verbose --tests"
    - run: "cargo test --verbose --doc"
    - run: "cargo doc --verbose"
    - name: "cargo test --docsrs"
      run: "cargo test --verbose --doc"
      env:
        RUSTFLAGS: "--cfg docsrs"
        RUSTDOCFLAGS: "--cfg docsrs"
    - name: "cargo docsrs"
      run: "cargo doc --verbose"
      env:
        RUSTFLAGS: "--cfg docsrs"
        RUSTDOCFLAGS: "--cfg docsrs"
    - run: "cargo build --verbose --release"
    - run: "cargo clippy --verbose"
