Skip to content

Commit

Permalink
add multiple database support
Browse files Browse the repository at this point in the history
  • Loading branch information
mozex committed Aug 5, 2024
1 parent e7c3a91 commit f861dee
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ on:
required: false
type: string
default: ''
databases:
description: 'Comma-separated list of database names to create'
required: false
type: string
default: 'testing'

permissions:
contents: write
Expand Down Expand Up @@ -53,7 +58,11 @@ jobs:
- name: Create Database
run: |
sudo systemctl start mysql
mysql --user="root" --password="root" -e "CREATE DATABASE \`testing\` character set UTF8mb4 collate utf8mb4_bin;"
IFS=',' read -ra DB_NAMES <<< "${{ inputs.databases }}"
for DB_NAME in "${DB_NAMES[@]}"; do
mysql --user="root" --password="root" -e "CREATE DATABASE \`$DB_NAME\` character set UTF8mb4 collate utf8mb4_bin;"
echo "Created database: $DB_NAME"
done
- name: Install Composer Dependencies
uses: ramsey/composer-install@v3
Expand Down

0 comments on commit f861dee

Please sign in to comment.