diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index db3be18..c43944d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 @@ -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 diff --git a/README.md b/README.md index cfbc89a..f046ef5 100644 --- a/README.md +++ b/README.md @@ -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). diff --git a/action.yml b/action.yml index 5aa2617..48803d9 100644 --- a/action.yml +++ b/action.yml @@ -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 @@ -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' diff --git a/entrypoint.sh b/entrypoint.sh index bc1d184..3395300 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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"