Update db.sql #64
Workflow file for this run
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: SQL Syntax Check | |
on: | |
pull_request: | |
paths: | |
- 'db.sql' | |
jobs: | |
syntax_check: | |
name: Check SQL Syntax | |
runs-on: ubuntu-latest | |
services: | |
mariadb: | |
image: mariadb:latest | |
ports: | |
- "3306:3306" | |
env: | |
MYSQL_RANDOM_ROOT_PASSWORD: "yes" | |
MARIADB_DATABASE: itflowdb | |
options: >- | |
--health-cmd="healthcheck.sh --connect --innodb_initialized" | |
--health-interval=10s | |
--health-timeout=5s | |
--health-retries=3 | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Run SQL Linting | |
run: | | |
password="${{ job.services.mariadb.env.MYSQL_ROOT_PASSWORD }}" | |
mysql --host 127.0.0.1 -uroot -p"$password" itflowdb < db.sql | |
- name: Show tables | |
run: | | |
password="${{ job.services.mariadb.env.MYSQL_ROOT_PASSWORD }}" | |
mysql --host 127.0.0.1 -uroot -p"$password" itflowdb -e "show tables;" |