Skip to content

Commit

Permalink
Add workflow with MySQL tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyMcCormick committed Aug 9, 2024
1 parent 0ec0380 commit 1a13712
Showing 1 changed file with 77 additions and 0 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/test_mysql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Test MySQL
on: [push]

jobs:

test:

runs-on: ubuntu-latest

services:
mariadb:
image: mariadb:10.6.8
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: rubin
MYSQL_PASSWORD: rubin
ports:
- 3306:3306
options: >-
--health-cmd "mysqladmin ping --silent"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:

- name: Check out repo
uses: actions/checkout@v4

- name: Setup Python and install dependencies
uses: ./.github/actions/setup

- name: Grant privileges to rubin MySQL user
run: |
mysql -h 127.0.0.1 -P 3306 -u root -proot -e "GRANT ALL PRIVILEGES ON *.* TO 'rubin'@'%' WITH GRANT OPTION; FLUSH PRIVILEGES;" > /dev/null 2>&1
- name: Set MySQL credentials
run: |
cat <<EOF > ~/.my.cnf
[client]
user=rubin
password=rubin
host=127.0.0.1
port=3306
EOF
chmod 600 ~/.my.cnf
- name: Set FELIS_ENGINE_URL
run: echo "FELIS_ENGINE_URL=mysql+pymysql://rubin:rubin@localhost:3306" >> $GITHUB_ENV

# There are currently errors creating databases for some schemas, so
# ignore errors for now.
- name: Create databases
run: |
set +e
./scripts/create-databases.sh
set -e
- name: Generate SQL files
run: |
./scripts/generate-sql-files.sh mysql
# Some SQL files do not load correctly, so ignore errors for now.
- name: Load SQL files
run: |
set +e
./scripts/test-load-sql-mysql.sh
set -e
- name: Initialize TAP_SCHEMA database
run: |
mysql -e "CREATE DATABASE TAP_SCHEMA;"
felis init-tap ${FELIS_ENGINE_URL}/TAP_SCHEMA
# Allow errors on this step as it is last to run.
- name: Upload to TAP_SCHEMA database
run: ./scripts/test-load-tap-mysql.sh

0 comments on commit 1a13712

Please sign in to comment.