fixup mariadb in CI #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rust | |
on: | |
push: | |
branches: [ "master", "dev" ] | |
pull_request: | |
branches: [ "master" ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
services: | |
mariadb: | |
image: mariadb:latest | |
ports: | |
- 3306 | |
env: | |
MYSQL_USER: user | |
MYSQL_PASSWORD: password | |
MYSQL_DATABASE: test | |
MYSQL_ROOT_PASSWORD: password | |
MYSQL_ALLOW_EMPTY_PASSWORD: yes | |
options: --health-cmd="healthcheck.sh --innodb_initialized || mysqladmin ping --protocol=tcp" --health-interval=2s --health-timeout=5s --health-retries=3 | |
env: | |
DB_DATABASE: test | |
DB_USER: root | |
DB_PASSWORD: root | |
steps: | |
- name: setup mariadb | |
run: | | |
mysql -e 'SET GLOBAL max_connections = 400;' -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} | |
mysql -e 'DROP DATABASE IF EXISTS ${{ env.DB_DATABASE }};' -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} | |
mysql -e 'CREATE DATABASE ${{ env.DB_DATABASE }};' -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} | |
- uses: actions/checkout@v3 | |
- name: Build | |
run: cargo build --verbose | |
- name: Run tests | |
run: bash test.sh |