name: CI

on:
  push:
  pull_request:
  schedule: [cron: "40 1 * * *"]

jobs:
  test:
    name: Test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: dtolnay/rust-toolchain@nightly
        with:
          components: rustfmt
      - run: cargo run -- expand --manifest-path tests/Cargo.toml > expand.rs
      - run: diff tests/lib.expand.rs expand.rs

  build:
    name: Rust ${{matrix.rust}}
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        rust: [nightly, beta, stable, 1.46.0]
    steps:
      - uses: actions/checkout@v2
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: ${{matrix.rust}}
      - run: cargo check
      - run: cargo update && cargo check

  clippy:
    name: Clippy
    runs-on: ubuntu-latest
    if: github.event_name != 'pull_request'
    steps:
      - uses: actions/checkout@v2
      - uses: dtolnay/rust-toolchain@clippy
      - run: cargo clippy --tests -- -Dclippy::all -Dclippy::pedantic

  outdated:
    name: Outdated
    runs-on: ubuntu-latest
    if: github.event_name != 'pull_request'
    steps:
      - uses: actions/checkout@v2
      - run: cargo update
      - run: cargo outdated --exit-code 1

name: CI

on:
  push:
  pull_request:
  schedule: [cron: "40 1 * * *"]

jobs:
  test:
    name: Test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: dtolnay/rust-toolchain@nightly
        with:
          components: rustfmt
      - run: cargo run -- expand --manifest-path tests/Cargo.toml > expand.rs
      - run: diff tests/lib.expand.rs expand.rs

  build:
    name: Rust ${{matrix.rust}}
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        rust: [nightly, beta, stable, 1.51.0]
    steps:
      - uses: actions/checkout@v2
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: ${{matrix.rust}}
      - run: cargo check
      - run: cargo update && cargo check

  clippy:
    name: Clippy
    runs-on: ubuntu-latest
    if: github.event_name != 'pull_request'
    steps:
      - uses: actions/checkout@v2
      - uses: dtolnay/rust-toolchain@clippy
      - run: cargo clippy --tests -- -Dclippy::all -Dclippy::pedantic

  outdated:
    name: Outdated
    runs-on: ubuntu-latest
    if: github.event_name != 'pull_request'
    steps:
      - uses: actions/checkout@v2
      - run: cargo update
      - run: cargo outdated --exit-code 1

Raise minimum tested compiler from 1.46 to 1.51
Raise minimum tested compiler from 1.46 to 1.51

Required by use of `resolver` in the `time` crate's Cargo.toml.

    error: failed to download `time v0.3.5`

    Caused by:
      unable to get packages from source

    Caused by:
      failed to parse manifest at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/time-0.3.5/Cargo.toml

    Caused by:
      feature `resolver` is required

      this Cargo does not support nightly features, but if you
      switch to nightly channel you can add
      `cargo-features = ["resolver"]` to enable this feature
