Try a different health check for MariaDB

This commit is contained in:
Ryan Leckey 2020-01-03 18:01:52 -08:00
parent cec532acb1
commit 77fbe3dd9e
2 changed files with 56 additions and 1 deletions

View File

@ -21,7 +21,7 @@ jobs:
# will assign a random free host port
- 3306/tcp
# needed because the container does not provide a healthcheck
options: --health-cmd "mysql --user=root --password=$MYSQL_PASSWORD -e 'show databases;'" --health-interval 30s --health-timeout 30s --health-retries 10
options: --health-cmd "mysqladmin ping --silent" --health-interval 30s --health-timeout 30s --health-retries 10
steps:
- uses: actions/checkout@v1

55
.github/workflows/mysql.yml vendored Normal file
View File

@ -0,0 +1,55 @@
name: MySQL
on: [push]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
mysql: [5.7.28, 8.0.18]
services:
mysql:
image: mysql:${{ matrix.mysql }}
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: sqlx
ports:
# will assign a random free host port
- 3306/tcp
# needed because the container does not provide a healthcheck
options: --health-cmd "mysqladmin ping --silent" --health-interval 30s --health-timeout 30s --health-retries 10
steps:
- uses: actions/checkout@v1
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-mysql-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ runner.os }}-mysql-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-mysql-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Setup rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- run: cargo test -p sqlx --no-default-features --features 'mysql macros chrono'
env:
DATABASE_URL: mysql://root:password@localhost:${{ job.services.mysql.ports[3306] }}/sqlx