From 571e4eb5d9a91de6038bece2121aa7d5a9414137 Mon Sep 17 00:00:00 2001 From: Billy Chan Date: Mon, 26 Jul 2021 12:46:35 +0800 Subject: [PATCH] Update GitHub actions --- .github/workflows/rust.yml | 67 +++++++++++++++++++++++++++++++------- 1 file changed, 55 insertions(+), 12 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 9a8e4c29..29554576 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -96,18 +96,6 @@ jobs: # runtime: [async-std-native-tls, async-std-rustls, actix-native-tls, actix-rustls, tokio-native-tls, tokio-rustls] runtime: [async-std-native-tls] services: - mysql: - image: mysql:8.0 - env: - MYSQL_HOST: 127.0.0.1 - MYSQL_DB: mysql - MYSQL_USER: sea - MYSQL_PASSWORD: sea - MYSQL_ALLOW_EMPTY_PASSWORD: yes - MYSQL_ROOT_PASSWORD: - ports: - - "3306:3306" - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 postgres: image: postgres:11 env: @@ -151,3 +139,58 @@ jobs: args: > --all --features default,sqlx-postgres,runtime-${{ matrix.runtime }} + + mysql: + name: MySQL + runs-on: ubuntu-20.04 + strategy: + matrix: + # runtime: [async-std-native-tls, async-std-rustls, actix-native-tls, actix-rustls, tokio-native-tls, tokio-rustls] + runtime: [async-std-native-tls] + services: + mysql: + image: mysql:8.0 + env: + MYSQL_HOST: 127.0.0.1 + MYSQL_DB: mysql + MYSQL_USER: sea + MYSQL_PASSWORD: sea + MYSQL_ALLOW_EMPTY_PASSWORD: yes + MYSQL_ROOT_PASSWORD: + 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/cache@v2 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-mysql-${{ matrix.runtime }}-${{ hashFiles('**/Cargo.lock') }} + + - uses: actions-rs/cargo@v1 + with: + command: build + args: > + --all + --features default,runtime-${{ matrix.runtime }} + + - uses: actions-rs/cargo@v1 + with: + command: test + args: > + --all + --features default,sqlx-mysql,runtime-${{ matrix.runtime }}