kube-coordinate 0.2.1

Kubernetes leader election using the coordination.k8s.io API.
Documentation
name: CI
on: [push, pull_request]
jobs:
  lint:
    name: lint
    runs-on: ubuntu-latest
    steps:
      - name: Setup | Checkout
        uses: actions/checkout@v2

      - uses: actions/cache@v2
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            target
          key: ${{ runner.os }}-lint
          restore-keys: |
            ${{ runner.os }}-lint

      - name: Setup | Toolchain (clippy)
        uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          default: true
          components: clippy

      - name: Build | Clippy
        uses: actions-rs/clippy-check@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          args: --all-targets

      - name: Setup | Toolchain (rustfmt)
        uses: actions-rs/toolchain@v1
        with:
          toolchain: nightly
          default: true
          components: rustfmt

      - name: Build | Rustfmt
        run: cargo fmt -- --check

  check:
    runs-on: ubuntu-latest
    steps:
      - name: Setup | Checkout
        uses: actions/checkout@v2

      - name: Setup | Cache Cargo
        uses: actions/cache@v2
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            target
          key: ${{ runner.os }}-check
          restore-keys: |
            ${{ runner.os }}-check

      - name: Setup | Rust
        uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          profile: minimal

      - name: Build | Check
        run: cargo check --all

  test:
    needs: check # Ensure check is run first.
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - name: Setup | Checkout
        uses: actions/checkout@v2

      - name: Setup | Cache Cargo
        uses: actions/cache@v2
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            target
          key: ${{ runner.os }}-cargo
          restore-keys: |
            ${{ runner.os }}-cargo

      - name: Setup | Rust
        uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          profile: minimal

      - name: Build | Test
        run: cargo test