Skip to content

Commit

Permalink
Add support for "extra conf" startup options
Browse files Browse the repository at this point in the history
We need this to be able to stop bin logs and other
configuration settings, because MySQL 8.0 comes with
it enabled by defaults and that eats the tmpfs
really quickly for big test suites.

This is built on top of mirromutth#6
that has been added to our fork already.
  • Loading branch information
stronk7 committed Jan 4, 2023
1 parent 4a26b8c commit ba84d30
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# MySQL GitHub Action [![Test status](https://github.com/mirromutth/mysql-action/workflows/test/badge.svg)](https://github.com/mirromutth/mysql-action/actions)
# MySQL GitHub Action [![Test status](https://github.com/mirromutth/mysql-action/workflows/test/badge.svg)](https://github.com/stronk7/mysql-action/actions)

This [GitHub Action](https://github.com/features/actions) sets up a MySQL database in Docker.

Expand All @@ -23,6 +23,10 @@ steps:
mysql password: ${{ secrets.DatabasePassword }} # Required if "mysql user" exists. The password for the "mysql user"
use tmpfs: true # Optional, default value is false. Mounts /var/lib/mysql to tmpfs (i.e. in RAM) for increased performance
tmpfs size: '2048M' # Optional, default value is '1024M'. Desired size of above-mentioned tmpfs volume
extra conf: | # Optional, default is ''. Other configuration options to be added on startup.
--max_allowed_packet=16MB
--skip-log-bin
...
```
If want bind MySQL host port to 3306, please see [The Default MySQL](#the-default-mysql).
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ inputs:
description: "Desired size of tmpfs volume"
required: false
default: "1024M"
extra conf:
description: "Other configuration options, to be added to the startup (--max_allowed_packet=16MB --skip-log-bin ...)"
required: false
default: ''
runs:
using: 'docker'
image: 'Dockerfile'
5 changes: 5 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,9 @@ 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"

if [ -n "$INPUT_EXTRA_CONF" ]; then
echo "Other startup extra configuration: $INPUT_EXTRA_CONF"

docker_run="$docker_run $INPUT_EXTRA_CONF"

sh -c "$docker_run"

0 comments on commit ba84d30

Please sign in to comment.