liff 0.1.0

Fast levenshtein diff, fastest as we can do with levenshtein.
Documentation
name: CI

on:
  push:
    branches: [main, staging, trying]
  pull_request:
    branches: [main]

env:
  CARGO_TERM_COLOR: always
  RUST_BACKTRACE: full

jobs:
  # Quick tests on each commit/PR
  sanity:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          submodules: 'recursive'
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: nightly
          components: rustfmt
          override: true
      - uses: Swatinem/rust-cache@v1
      - uses: actions-rs/cargo@v1
        with:
          command: fmt
          args: --all -- --check

  check:
    if: github.ref != 'refs/heads/staging'
    needs: sanity
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          submodules: 'recursive'
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: nightly
          override: true
      - uses: Swatinem/rust-cache@v1
      - uses: actions-rs/cargo@v1
        with:
          command: check

  test:
    if: github.ref != 'refs/heads/staging'
    needs: check
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          submodules: 'recursive'
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: nightly
          override: true
      - uses: Swatinem/rust-cache@v1
      - uses: actions-rs/cargo@v1
        with:
          command: build # needed by assert_cmd based tests
      - uses: actions-rs/cargo@v1
        with:
          command: test
          args: --lib

  doctest:
    if: github.ref != 'refs/heads/staging'
    needs: check
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          submodules: 'recursive'
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: nightly
          override: true
      - uses: Swatinem/rust-cache@v1
      - uses: actions-rs/cargo@v1
        with:
          command: test
          args: --doc

  clippy:
    if: github.ref != 'refs/heads/staging'
    needs: check
    runs-on: ubuntu-latest
    continue-on-error: true
    steps:
      - uses: actions/checkout@v2
        with:
          submodules: 'recursive'
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: nightly
          components: clippy
          override: true
      - uses: Swatinem/rust-cache@v1
      - uses: actions-rs/clippy-check@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          args: --all-features

  # Full cross-platform tests required by bors to merge on main branch
  full:
    if: github.ref == 'refs/heads/staging'
    name: full
    needs: sanity
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os:
          - ubuntu-latest
          # FIXME: - macOS-latest
          - windows-latest
    steps:
      - uses: actions/checkout@v2
        with:
          submodules: 'recursive'
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: nightly
          override: true
      - uses: Swatinem/rust-cache@v1
      - uses: actions-rs/cargo@v1
        with:
          command: build
      - uses: actions-rs/cargo@v1
        with:
          command: test

  build: # quick hack because bors wrongly detect matrix jobs status
    if: github.ref == 'refs/heads/staging'
    needs: full
    runs-on: ubuntu-latest
    steps:
      - run: exit 0

  doc:
    runs-on: ubuntu-latest
    if: github.ref == 'refs/heads/main'
    steps:
      - uses: actions/checkout@v2
        with:
          submodules: 'recursive'
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: nightly
          components: rustfmt
          override: true
      - uses: actions-rs/cargo@v1
        with:
          command: doc
          args: --no-deps
      - uses: JamesIves/github-pages-deploy-action@4.1.7
        with:
          branch: gh-pages
          folder: target/doc