sqlint 0.2.2

An abstraction layer for SQL databases.
Documentation
name: Cargo tests
on:
  push:
    branches:
      - main
  pull_request:
jobs:
  clippy:
    runs-on: ubuntu-latest
    env:
      RUSTFLAGS: "-Dwarnings"
    steps:
      - uses: actions/checkout@v1
      - uses: actions-rs/toolchain@v1
        with:
            components: clippy
            override: true
            toolchain: stable
      - name: Install dependencies
        run: sudo apt install -y openssl libkrb5-dev
      - uses: actions-rs/clippy-check@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          args: --features=all

  format:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
      - uses: actions-rs/toolchain@v1
        with:
          components: rustfmt
          override: true
          toolchain: stable
      - uses: mbrobbel/rustfmt-check@master
        with:
          token: ${{ secrets.GITHUB_TOKEN }}

  cargo-test:
    runs-on: ubuntu-latest

    strategy:
      fail-fast: false
      matrix:
        features:
          - "--lib --features=all"
          - "--lib --no-default-features --features=sqlite"
          - "--lib --no-default-features --features=sqlite --features=chrono --features=json --features=uuid --features=pooled --features=serde-support --features=bigdecimal"
          - "--lib --no-default-features --features=postgresql"
          - "--lib --no-default-features --features=postgresql --features=chrono --features=json --features=uuid --features=pooled --features=serde-support --features=bigdecimal"
          - "--lib --no-default-features --features=mysql"
          - "--lib --no-default-features --features=mysql --features=chrono --features=json --features=uuid --features=pooled --features=serde-support --features=bigdecimal"
          - "--lib --no-default-features --features=mssql"
          - "--lib --no-default-features --features=mssql --features=chrono --features=json --features=uuid --features=pooled --features=serde-support --features=bigdecimal"
          - "--doc --features=all"
    env:
      TEST_MYSQL: "mysql://root:khulnasoft@localhost:3306/khulnasoft"
      TEST_MYSQL8: "mysql://root:khulnasoft@localhost:3307/khulnasoft"
      TEST_MYSQL_MARIADB: "mysql://root:khulnasoft@localhost:3308/khulnasoft"
      TEST_PSQL: "postgres://postgres:khulnasoft@localhost:5432/postgres"
      TEST_MSSQL: "jdbc:sqlserver://localhost:1433;database=master;user=SA;password=<YourStrong@Passw0rd>;trustServerCertificate=true"
      TEST_CRDB: "postgresql://khulnasoft@127.0.0.1:26259/postgres"
      RUSTFLAGS: "-Dwarnings"

    steps:
      - uses: actions/checkout@v2

      - uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          override: true

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

      - name: Start Databases
        run: docker-compose -f docker-compose.yml up -d

      - name: Sleep for 20s
        uses: juliangruber/sleep-action@v1
        with:
          time: 20s

      - name: Run tests
        run: cargo test ${{ matrix.features }}

  rustdoc:
    needs: [clippy, format, cargo-test]
    runs-on: ubuntu-latest
    if: github.ref == 'refs/heads/main'

    steps:
      - uses: actions/checkout@v2
      - uses: actions-rs/toolchain@v1
        with:
          toolchain: nightly

      - uses: actions/cache@v2
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            target
          key: linux-cargo-rustdoc

      - name: Generate documentation
        run: |
          cargo +nightly rustdoc --all-features

      - name: Deploy Documentation
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          PUBLISH_BRANCH: gh-pages
          PUBLISH_DIR: ./target/doc
          SCRIPT_MODE: true
        run: |
          wget https://gist.githubusercontent.com/NxPKG/9ffa57cfc2228219785228e544014114/raw/9548ccd44039ef52121541cb45dff6a356317806/entrypoint.sh
          bash ./entrypoint.sh