Swap 8.x for 5.7 #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: MySQL Service Connect | |
on: | |
push: | |
workflow_dispatch: | |
jobs: | |
check-mysql: | |
name: Check MySQL connection | |
runs-on: ubuntu-latest | |
services: | |
mysql: | |
image: mysql:5.7 | |
ports: | |
- 3306:3306 | |
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: | |
- name: List containers | |
run: docker ps -a | |
- run: | | |
docker exec mysql_container mysql --version | |
docker exec mysql_container mysql --protocol tcp --host localhost --port 3306 -uroot -ppassword -e "SHOW DATABASES" | |
- name: Show local MySQL version | |
run: mysql --version | |
- name: Verify MySQL connection from host | |
run: mysql --protocol tcp --host localhost --port 3306 -uroot -ppassword -e "SHOW DATABASES" |