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
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, 10.5, 10.4, 10.3, 10.2]
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: [13.3, 12.7, 11.12, 10.17, 9.6.22]
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
cockroach:
name: CockroachDB
runs-on: ubuntu-20.04
strategy:
matrix:
example: [cockroach, cockroach_json]
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