redis-enterprise 0.9.1

Redis Enterprise REST API client library
Documentation
name: CI

on:
  push:
    branches: [main]
    paths-ignore:
      - "**.md"
      - "LICENSE*"
      - ".gitignore"
  pull_request:
    branches: [main]
    paths-ignore:
      - "**.md"
      - "LICENSE*"
      - ".gitignore"

env:
  CARGO_TERM_COLOR: always
  RUST_BACKTRACE: short
  CARGO_INCREMENTAL: 1
  RUSTFLAGS: "-C debuginfo=0"

concurrency:
  group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
  cancel-in-progress: true

jobs:
  check:
    name: Check
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt, clippy

      - name: Cache cargo
        uses: Swatinem/rust-cache@v2

      - name: Check formatting
        run: cargo fmt --all -- --check

      - name: Run clippy
        run: cargo clippy --all-targets --all-features -- -D warnings

  test:
    name: Test
    needs: check
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable

      - name: Cache cargo
        uses: Swatinem/rust-cache@v2

      - name: Run unit tests
        run: cargo test --lib --all-features

      - name: Run integration tests
        run: cargo test --test '*' --all-features

  build:
    name: Build - ${{ matrix.os }}
    needs: test
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
    steps:
      - uses: actions/checkout@v4

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable

      - name: Cache cargo
        uses: Swatinem/rust-cache@v2

      - name: Build
        run: cargo build --all-features

  ci-status:
    name: CI Status
    runs-on: ubuntu-latest
    needs: [check, test, build]
    if: always()
    steps:
      - name: Check CI status
        run: |
          if [[ "${{ needs.check.result }}" != "success" ]]; then
            echo "Check failed"
            exit 1
          fi
          if [[ "${{ needs.test.result }}" != "success" ]]; then
            echo "Tests failed"
            exit 1
          fi
          echo "CI passed!"