Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for mariadb + default authentication plugin #7

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ jobs:
strategy:
matrix:
node-version: ['10.x']
mysql-variant: ['mysql', 'mariadb']
mysql-version: ['5.7', '8.0', '10.3']
exclude:
- node-version: '10.x'
mysql-variant: 'mysql'
mysql-version: '10.3'
- node-version: '10.x'
mysql-variant: 'mariadb'
mysql-version: '5.7'
- node-version: '10.x'
mysql-variant: 'mariadb'
mysql-version: '8.0'

steps:
- uses: actions/checkout@v1
Expand All @@ -24,10 +36,11 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Set up MySQL 5.7
uses: mirromutth/mysql-action@master
- name: Set up ${{ matrix.mysql-variant }} ${{ matrix.mysql-version }}
uses: ./
with:
mysql version: 5.7
mysql variant: ${{ matrix.mysql-variant }}
mysql version: ${{ matrix.mysql-version }}
mysql database: test
mysql root password: ${{ secrets.DatabasePassword }}
- name: npm install, build, and test
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ steps:
container port: 3307 # Optional, default value is 3306. The port of container
character set server: 'utf8' # Optional, default value is 'utf8mb4'. The '--character-set-server' option for mysqld
collation server: 'utf8_general_ci' # Optional, default value is 'utf8mb4_general_ci'. The '--collation-server' option for mysqld
mysql variant: 'mysql' # Optional, default value is 'mysql'. Change to mariadb, if needed.
mysql version: '8.0' # Optional, default value is "latest". The version of the MySQL
mysql database: 'some_test' # Optional, default value is "test". The specified database which will be create
mysql root password: ${{ secrets.RootPassword }} # Required if "mysql user" is empty, default is empty. The root superuser password
mysql user: 'developer' # Required if "mysql root password" is empty, default is empty. The superuser for the specified database. Can use secrets, too
mysql password: ${{ secrets.DatabasePassword }} # Required if "mysql user" exists. The password for the "mysql user"
authentication plugin: 'mysql_old_password' # Optional, default value is "mysql_native_password". This was the standard plugin in MySQL before 8.0 version.
```

If want bind MySQL host port to 3306, please see [The Default MySQL](#the-default-mysql).
Expand Down
8 changes: 8 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ inputs:
description: '--collation-server - The character collation of MySQL server'
required: false
default: 'utf8mb4_general_ci'
mysql variant:
description: 'Variant (fork) of MySQL. Values: mysql, mariadb.'
required: false
default: 'mysql'
mysql version:
description: 'Version of MySQL to use'
required: false
Expand All @@ -41,6 +45,10 @@ inputs:
description: 'MYSQL_PASSWORD - specified superuser password which user is power for created database'
required: false
default: ''
authentication plugin:
description: 'Set authentication plugin. Login/password is used as default. Changes default behaviour of MySQL 8.0+, where `caching_sha2_password` is a default value.'
required: false
default: 'mysql_native_password'
runs:
using: 'docker'
image: 'Dockerfile'
4 changes: 2 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if [ -n "$INPUT_MYSQL_DATABASE" ]; then
docker_run="$docker_run -e MYSQL_DATABASE=$INPUT_MYSQL_DATABASE"
fi

docker_run="$docker_run -d -p $INPUT_HOST_PORT:$INPUT_CONTAINER_PORT mysql:$INPUT_MYSQL_VERSION --port=$INPUT_CONTAINER_PORT"
docker_run="$docker_run --character-set-server=$INPUT_CHARACTER_SET_SERVER --collation-server=$INPUT_COLLATION_SERVER"
docker_run="$docker_run -d -p $INPUT_HOST_PORT:$INPUT_CONTAINER_PORT $INPUT_MYSQL_VARIANT:$INPUT_MYSQL_VERSION --port=$INPUT_CONTAINER_PORT"
docker_run="$docker_run --character-set-server=$INPUT_CHARACTER_SET_SERVER --collation-server=$INPUT_COLLATION_SERVER --default-authentication-plugin=$INPUT_AUTHENTICATION_PLUGIN"

sh -c "$docker_run"