on: [push, pull_request]
name: CI
jobs:
  clippy_rustfmt:
    name: Lint & Format
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Install stable toolchain
        uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          components: rustfmt, clippy

      - name: Clippy
        uses: actions-rs/cargo@v1
        with:
          command: clippy
          args: --all-features

      - name: Format
        uses: actions-rs/cargo@v1
        with:
          command: fmt
          args: -- --check

  test:
    name: Build & Test
    runs-on: ubuntu-latest
    strategy:
      matrix:
        rust:
          - stable
          - nightly
          - 1.41.1
        features:
          - default
          - ssl
    steps:
      - uses: actions/checkout@v2
      - name: Install toolchain
        uses: actions-rs/toolchain@v1
        with:
          toolchain: ${{ matrix.rust }}
          override: true

      - name: Build
        uses: actions-rs/cargo@v1
        with:
          command: build
          args: --features ${{ matrix.features }}

      - name: Test
        uses: actions-rs/cargo@v1
        with:
          command: test
          args: --features ${{ matrix.features }}

on: [push, pull_request]
name: CI
jobs:
  clippy_rustfmt:
    name: Lint & Format
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Install stable toolchain
        uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          components: rustfmt, clippy

      - name: Clippy
        uses: actions-rs/cargo@v1
        with:
          command: clippy
          args: --all-features

      - name: Format
        uses: actions-rs/cargo@v1
        with:
          command: fmt
          args: -- --check

  test:
    name: Build & Test
    runs-on: ubuntu-latest
    strategy:
      matrix:
        rust:
          - stable
          - nightly
          - 1.48
        features:
          - default
          - ssl
    steps:
      - uses: actions/checkout@v2
      - name: Install toolchain
        uses: actions-rs/toolchain@v1
        with:
          toolchain: ${{ matrix.rust }}
          override: true

      - name: Build
        uses: actions-rs/cargo@v1
        with:
          command: build
          args: --features ${{ matrix.features }}

      - name: Test
        uses: actions-rs/cargo@v1
        with:
          command: test
          args: --features ${{ matrix.features }}

Test against MSRV 1.48 rather than 1.41.1
Test against MSRV 1.48 rather than 1.41.1

The OpenSSL crate has introduced a breaking change with 0.10.36 which
menas they now rely on const fn support not available in 1.41.1.

As only one OpenSSL version can be supported in a single Rust project,
and the change was released as a patch increment so Cargo will always
select this as the desired version, there's not much point in us testing
tiny-http on such an old compiler version anymore.
