Update Workflow

This commit is contained in:
Billy Chan 2021-08-29 22:20:06 +08:00 committed by Chris Tsang
parent 0e7c700183
commit 4af7d1c6c2

View File

@ -11,12 +11,11 @@ env:
jobs: jobs:
compile: compile-sqlite:
name: Compile name: Compile SQLite
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
strategy: strategy:
matrix: matrix:
database: [sqlite, mysql, postgres]
runtime: [async-std, actix, tokio] runtime: [async-std, actix, tokio]
tls: [native-tls, rustls] tls: [native-tls, rustls]
steps: steps:
@ -35,13 +34,77 @@ jobs:
~/.cargo/git ~/.cargo/git
Cargo.lock Cargo.lock
target target
key: ${{ github.sha }}-${{ github.run_id }}-${{ runner.os }}-${{ matrix.database }}-${{ matrix.runtime }}-${{ matrix.tls }} key: ${{ github.sha }}-${{ github.run_id }}-${{ runner.os }}-sqlite-${{ matrix.runtime }}-${{ matrix.tls }}
- uses: actions-rs/cargo@v1 - uses: actions-rs/cargo@v1
with: with:
command: test command: test
args: > args: >
--features default,sqlx-${{ matrix.database }},runtime-${{ matrix.runtime }}-${{ matrix.tls }} --features default,sqlx-sqlite,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
--no-run
compile-mysql:
name: Compile MySQL
runs-on: ubuntu-20.04
strategy:
matrix:
runtime: [async-std, actix, tokio]
tls: [native-tls, rustls]
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
Cargo.lock
target
key: ${{ github.sha }}-${{ github.run_id }}-${{ runner.os }}-mysql-${{ matrix.runtime }}-${{ matrix.tls }}
- uses: actions-rs/cargo@v1
with:
command: test
args: >
--features default,sqlx-mysql,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
--no-run
compile-postgres:
name: Compile PostgreSQL
runs-on: ubuntu-20.04
strategy:
matrix:
runtime: [async-std, actix, tokio]
tls: [native-tls, rustls]
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
Cargo.lock
target
key: ${{ github.sha }}-${{ github.run_id }}-${{ runner.os }}-postgres-${{ matrix.runtime }}-${{ matrix.tls }}
- uses: actions-rs/cargo@v1
with:
command: test
args: >
--features default,sqlx-postgres,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
--no-run --no-run
test: test:
@ -89,6 +152,7 @@ jobs:
strategy: strategy:
matrix: matrix:
os: [ubuntu-latest] os: [ubuntu-latest]
path: [async-std, tokio]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@ -102,18 +166,12 @@ jobs:
with: with:
command: build command: build
args: > args: >
--manifest-path examples/async-std/Cargo.toml --manifest-path examples/${{ matrix.path }}/Cargo.toml
- uses: actions-rs/cargo@v1
with:
command: build
args: >
--manifest-path examples/tokio/Cargo.toml
sqlite: sqlite:
name: SQLite name: SQLite
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
needs: compile needs: compile-sqlite
env: env:
DATABASE_URL: "sqlite::memory:" DATABASE_URL: "sqlite::memory:"
strategy: strategy:
@ -147,7 +205,7 @@ jobs:
mysql: mysql:
name: MySQL name: MySQL
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
needs: compile needs: compile-mysql
env: env:
DATABASE_URL: "mysql://root:@localhost" DATABASE_URL: "mysql://root:@localhost"
strategy: strategy:
@ -199,7 +257,7 @@ jobs:
mariadb: mariadb:
name: MariaDB name: MariaDB
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
needs: compile needs: compile-mysql
env: env:
DATABASE_URL: "mysql://root:@localhost" DATABASE_URL: "mysql://root:@localhost"
strategy: strategy:
@ -251,7 +309,7 @@ jobs:
postgres: postgres:
name: Postgres name: Postgres
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
needs: compile needs: compile-postgres
env: env:
DATABASE_URL: "postgres://root:root@localhost" DATABASE_URL: "postgres://root:root@localhost"
strategy: strategy: