sea-query 0.26.3

🌊 A dynamic query builder for MySQL, Postgres and SQLite
Documentation
name: tests

on:
  pull_request:
  push:
    branches:
      - master

env:
  CARGO_TERM_COLOR: always

jobs:
  clippy:
    name: Clippy
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v2

      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          components: clippy
          override: true
          
      - uses: actions-rs/cargo@v1
        with:
          command: clippy
          args: >
            --all-targets
            --all-features
            --workspace

  build:
    name: Build
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v2

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

      - uses: actions-rs/cargo@v1
        with:
          command: build
          args: --no-default-features

      - uses: actions-rs/cargo@v1
        with:
          command: build
          args: --all-features

      - uses: actions-rs/cargo@v1
        with:
          command: build
          args: --features=thread-safe

      - uses: actions-rs/cargo@v1
        with:
          command: build
          args: --features=with-chrono

      - uses: actions-rs/cargo@v1
        with:
          command: build
          args: --features=with-json

      - uses: actions-rs/cargo@v1
        with:
          command: build
          args: --features=with-rust_decimal

      - uses: actions-rs/cargo@v1
        with:
          command: build
          args: --features=with-uuid

  test:
    name: Unit Test
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v2

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

      - uses: actions-rs/cargo@v1
        with:
          command: test
          args: --all-features

  derive-test:
    name: Derive Tests
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v2

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

      - uses: Swatinem/rust-cache@v1

      - uses: actions-rs/cargo@v1
        with:
          command: build
          args: --package sea-query-derive --all-features

      - uses: actions-rs/cargo@v1
        with:
          command: test
          args: --package sea-query-derive --all-features

  sqlite:
    name: SQLite
    runs-on: ubuntu-20.04
    strategy:
      matrix:
        example: [rusqlite, sqlx_sqlite]
    steps:
      - uses: actions/checkout@v2

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

      - uses: actions-rs/cargo@v1
        with:
          command: build
          args: --manifest-path examples/${{ matrix.example }}/Cargo.toml

      - uses: actions-rs/cargo@v1
        with:
          command: run
          args: --manifest-path examples/${{ matrix.example }}/Cargo.toml

  mysql:
    name: MySQL
    runs-on: ubuntu-20.04
    strategy:
      matrix:
        version: [8.0, 5.7]
        example: [sqlx_mysql]
    services:
      mysql:
        image: mysql:${{ matrix.version }}
        env:
          MYSQL_HOST: 127.0.0.1
          MYSQL_DATABASE: query
          MYSQL_USER: sea
          MYSQL_PASSWORD: sea
          MYSQL_ROOT_PASSWORD: sea
        ports:
          - "3306:3306"
        options: >-
          --health-cmd="mysqladmin ping"
          --health-interval=10s
          --health-timeout=5s
          --health-retries=3
    steps:
      - uses: actions/checkout@v2

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

      - uses: actions-rs/cargo@v1
        with:
          command: build
          args: --manifest-path examples/${{ matrix.example }}/Cargo.toml

      - uses: actions-rs/cargo@v1
        with:
          command: run
          args: --manifest-path examples/${{ matrix.example }}/Cargo.toml

  mariadb:
    name: MariaDB
    runs-on: ubuntu-20.04
    strategy:
      matrix:
        version: [10.6]
        example: [sqlx_mysql]
    services:
      mariadb:
        image: mariadb:${{ matrix.version }}
        env:
          MYSQL_HOST: 127.0.0.1
          MYSQL_DATABASE: query
          MYSQL_USER: sea
          MYSQL_PASSWORD: sea
          MYSQL_ROOT_PASSWORD: sea
        ports:
          - "3306:3306"
        options: >-
          --health-cmd="mysqladmin ping"
          --health-interval=10s
          --health-timeout=5s
          --health-retries=3
    steps:
      - uses: actions/checkout@v2

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

      - uses: actions-rs/cargo@v1
        with:
          command: build
          args: --manifest-path examples/${{ matrix.example }}/Cargo.toml

      - uses: actions-rs/cargo@v1
        with:
          command: run
          args: --manifest-path examples/${{ matrix.example }}/Cargo.toml

  postgres:
    name: PostgreSQL
    runs-on: ubuntu-20.04
    strategy:
      matrix:
        version: [14.4, 13.7, 12.11]
        example: [postgres, postgres_json, sqlx_postgres]
    services:
      postgres:
        image: postgres:${{ matrix.version }}
        env:
          POSTGRES_HOST: 127.0.0.1
          POSTGRES_DB: query
          POSTGRES_USER: sea
          POSTGRES_PASSWORD: sea
        ports:
          - "5432:5432"
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
    steps:
      - uses: actions/checkout@v2

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

      - uses: actions-rs/cargo@v1
        with:
          command: build
          args: --manifest-path examples/${{ matrix.example }}/Cargo.toml

      - uses: actions-rs/cargo@v1
        with:
          command: run
          args: --manifest-path examples/${{ matrix.example }}/Cargo.toml