See if we can connect from within the container #5
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: MySQL Service Connect | |
on: | |
push: | |
workflow_dispatch: | |
jobs: | |
unit-test: | |
name: Unit Testing | |
runs-on: ubuntu-latest | |
services: | |
mysql: | |
image: mysql:8.0 | |
options: --name mysql_container --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5 -e MYSQL_ROOT_PASSWORD=password -e MYSQL_USER=test -e MYSQL_PASSWORD=test -e MYSQL_DATABASE=e2e-tests --entrypoint sh mysql:8 -c "exec docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password" | |
steps: | |
- run: docker exec mysql_container mysql --protocol tcp --host localhost --port 3306 -uroot -ppassword -e "SHOW DATABASES" | |
- name: Verify MySQL connection from host | |
run: mysql --protocol tcp --host localhost --port 3306 -uroot -ppassword -e "SHOW DATABASES" |