name: ci
on: [push, pull_request]
jobs:
  test:
    name: test
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest, macOS-latest]
        rust: [1.45.0, stable, beta, nightly]
    steps:
    - name: Checkout repository
      uses: actions/checkout@v1
    - name: Install Rust
      uses: hecrj/setup-rust-action@v1
      with:
        rust-version: ${{ matrix.rust }}
    - if: matrix.rust != 'nightly'
      run: rustup component add clippy
    - if: matrix.rust != 'nightly'
      run: cargo clippy --all-features -- -D warnings
    - if: matrix.rust == 'stable' && matrix.os == 'ubuntu-latest'
      run: cargo fmt --all -- --check
    - run: cargo build --no-default-features --verbose
    - run: cargo test --features="master resolv resolv-sync sign tsig validate" --verbose
    - if: matrix.rust == 'nightly'
      run: |
        cargo +nightly update -Z minimal-versions
        cargo check --features="master resolv resolv-sync sign tsig validate" --verbose --all-targets
        cargo test --features="master resolv resolv-sync sign tsig validate"
      name: Check and test with minimal-versions
