Skip to content

Commit

Permalink
Break drivers out into separate crates, clean up some technical debt (#…
Browse files Browse the repository at this point in the history
…2039)

* WIP rt refactors

* refactor: break drivers out into separate crates

also cleans up significant technical debt
  • Loading branch information
abonander committed Feb 18, 2023
1 parent 11c69a2 commit 99142cb
Show file tree
Hide file tree
Showing 400 changed files with 7,084 additions and 11,038 deletions.
92 changes: 27 additions & 65 deletions .github/workflows/sqlx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
runtime: [async-std, tokio, actix]
tls: [native-tls, rustls]
runtime: [async-std, tokio]
tls: [native-tls, rustls, none]
steps:
- uses: actions/checkout@v2

Expand All @@ -54,22 +54,22 @@ jobs:
args: >
--manifest-path sqlx-core/Cargo.toml
--no-default-features
--features offline,all-databases,all-types,migrate,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
--features json,offline,migrate,_rt-${{ matrix.runtime }},_tls-${{ matrix.tls }}
- uses: actions-rs/cargo@v1
with:
command: check
args: >
--no-default-features
--features offline,all-databases,all-types,migrate,runtime-${{ matrix.runtime }}-${{ matrix.tls }},macros
--features all-databases,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }},macros
test:
name: Unit Test
runs-on: ubuntu-20.04
strategy:
matrix:
runtime: [async-std, tokio, actix]
tls: [native-tls, rustls]
runtime: [async-std, tokio]
tls: [native-tls, rustls, none]
steps:
- uses: actions/checkout@v2

Expand All @@ -88,7 +88,7 @@ jobs:
command: test
args: >
--manifest-path sqlx-core/Cargo.toml
--features offline,all-databases,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
--features json,_rt-${{ matrix.runtime }},_tls-${{ matrix.tls }}
cli:
name: CLI Binaries
Expand Down Expand Up @@ -139,8 +139,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
runtime: [async-std, tokio, actix]
tls: [native-tls, rustls]
runtime: [async-std, tokio]
needs: check
steps:
- uses: actions/checkout@v2
Expand All @@ -157,16 +156,18 @@ jobs:
with:
key: ${{ runner.os }}-sqlite-${{ matrix.runtime }}-${{ matrix.tls }}

- run: echo "using ${DATABASE_URL}"

- uses: actions-rs/cargo@v1
with:
command: test
args: >
--no-default-features
--features any,macros,migrate,sqlite,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
--features any,macros,sqlite,_unstable-all-types,runtime-${{ matrix.runtime }}
--
--test-threads=1
env:
DATABASE_URL: sqlite://tests/sqlite/sqlite.db
DATABASE_URL: sqlite:tests/sqlite/sqlite.db
RUSTFLAGS: --cfg sqlite_ipaddr
LD_LIBRARY_PATH: /tmp/sqlite3-lib

Expand All @@ -176,8 +177,8 @@ jobs:
strategy:
matrix:
postgres: [14, 10]
runtime: [async-std, tokio, actix]
tls: [native-tls, rustls]
runtime: [async-std, tokio]
tls: [native-tls, rustls, none]
needs: check
steps:
- uses: actions/checkout@v2
Expand All @@ -200,7 +201,7 @@ jobs:
with:
command: build
args: >
--features postgres,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
--features postgres,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
- run: |
docker-compose -f tests/docker-compose.yml run -d -p 5432:5432 --name postgres_${{ matrix.postgres }} postgres_${{ matrix.postgres }}
Expand All @@ -211,19 +212,20 @@ jobs:
command: test
args: >
--no-default-features
--features any,postgres,macros,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
--features any,postgres,macros,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
env:
DATABASE_URL: postgres://postgres:password@localhost:5432/sqlx
# FIXME: needed to disable `ltree` tests in Postgres 9.6
# but `PgLTree` should just fall back to text format
RUSTFLAGS: --cfg postgres_${{ matrix.postgres }}

- uses: actions-rs/cargo@v1
if: matrix.tls != 'none'
with:
command: test
args: >
--no-default-features
--features any,postgres,macros,migrate,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
--features any,postgres,macros,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
env:
DATABASE_URL: postgres://postgres:password@localhost:5432/sqlx?sslmode=verify-ca&sslrootcert=.%2Ftests%2Fcerts%2Fca.crt
# FIXME: needed to disable `ltree` tests in Postgres 9.6
Expand All @@ -236,8 +238,8 @@ jobs:
strategy:
matrix:
mysql: [8, 5_7]
runtime: [async-std, tokio, actix]
tls: [native-tls, rustls]
runtime: [async-std, tokio]
tls: [native-tls, rustls, none]
needs: check
steps:
- uses: actions/checkout@v2
Expand All @@ -256,7 +258,7 @@ jobs:
with:
command: build
args: >
--features mysql,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
--features mysql,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
- run: docker-compose -f tests/docker-compose.yml run -d -p 3306:3306 mysql_${{ matrix.mysql }}
- run: sleep 60
Expand All @@ -266,7 +268,7 @@ jobs:
command: test
args: >
--no-default-features
--features any,mysql,macros,migrate,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
--features any,mysql,macros,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
env:
DATABASE_URL: mysql://root:password@localhost:3306/sqlx?ssl-mode=disabled

Expand All @@ -277,7 +279,7 @@ jobs:
command: test
args: >
--no-default-features
--features any,mysql,macros,migrate,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
--features any,mysql,macros,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
env:
DATABASE_URL: mysql://root:password@localhost:3306/sqlx

Expand All @@ -287,8 +289,8 @@ jobs:
strategy:
matrix:
mariadb: [10_6, 10_3]
runtime: [async-std, tokio, actix]
tls: [native-tls, rustls]
runtime: [async-std, tokio]
tls: [native-tls, rustls, none]
needs: check
steps:
- uses: actions/checkout@v2
Expand All @@ -307,7 +309,7 @@ jobs:
with:
command: build
args: >
--features mysql,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
--features mysql,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
- run: docker-compose -f tests/docker-compose.yml run -d -p 3306:3306 mariadb_${{ matrix.mariadb }}
- run: sleep 30
Expand All @@ -317,46 +319,6 @@ jobs:
command: test
args: >
--no-default-features
--features any,mysql,macros,migrate,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
--features any,mysql,macros,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
env:
DATABASE_URL: mysql://root:password@localhost:3306/sqlx

mssql:
name: MSSQL
runs-on: ubuntu-20.04
strategy:
matrix:
mssql: [2019, 2017]
runtime: [async-std, tokio, actix]
tls: [native-tls, rustls]
needs: check
steps:
- uses: actions/checkout@v2

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

- uses: Swatinem/rust-cache@v1
with:
key: ${{ runner.os }}-mssql-${{ matrix.runtime }}-${{ matrix.tls }}-${{ hashFiles('**/Cargo.lock') }}

- uses: actions-rs/cargo@v1
with:
command: build
args: >
--features mssql,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
- run: docker-compose -f tests/docker-compose.yml run -d -p 1433:1433 mssql_${{ matrix.mssql }}
- run: sleep 80 # MSSQL takes a "bit" to startup

- uses: actions-rs/cargo@v1
with:
command: test
args: >
--no-default-features
--features any,mssql,macros,migrate,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
env:
DATABASE_URL: mssql://sa:Password123!@localhost/sqlx
Loading

0 comments on commit 99142cb

Please sign in to comment.