Skip to content

Commit ba84d30

Browse files
committed
Add support for "extra conf" startup options
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.
1 parent 4a26b8c commit ba84d30

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# MySQL GitHub Action [![Test status](https://github.com/mirromutth/mysql-action/workflows/test/badge.svg)](https://github.com/mirromutth/mysql-action/actions)
1+
# MySQL GitHub Action [![Test status](https://github.com/mirromutth/mysql-action/workflows/test/badge.svg)](https://github.com/stronk7/mysql-action/actions)
22

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

@@ -23,6 +23,10 @@ steps:
2323
mysql password: ${{ secrets.DatabasePassword }} # Required if "mysql user" exists. The password for the "mysql user"
2424
use tmpfs: true # Optional, default value is false. Mounts /var/lib/mysql to tmpfs (i.e. in RAM) for increased performance
2525
tmpfs size: '2048M' # Optional, default value is '1024M'. Desired size of above-mentioned tmpfs volume
26+
extra conf: | # Optional, default is ''. Other configuration options to be added on startup.
27+
--max_allowed_packet=16MB
28+
--skip-log-bin
29+
...
2630
```
2731
2832
If want bind MySQL host port to 3306, please see [The Default MySQL](#the-default-mysql).

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ inputs:
4949
description: "Desired size of tmpfs volume"
5050
required: false
5151
default: "1024M"
52+
extra conf:
53+
description: "Other configuration options, to be added to the startup (--max_allowed_packet=16MB --skip-log-bin ...)"
54+
required: false
55+
default: ''
5256
runs:
5357
using: 'docker'
5458
image: 'Dockerfile'

entrypoint.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,9 @@ fi
3333
docker_run="$docker_run -d -p $INPUT_HOST_PORT:$INPUT_CONTAINER_PORT mysql:$INPUT_MYSQL_VERSION --port=$INPUT_CONTAINER_PORT"
3434
docker_run="$docker_run --character-set-server=$INPUT_CHARACTER_SET_SERVER --collation-server=$INPUT_COLLATION_SERVER"
3535

36+
if [ -n "$INPUT_EXTRA_CONF" ]; then
37+
echo "Other startup extra configuration: $INPUT_EXTRA_CONF"
38+
39+
docker_run="$docker_run $INPUT_EXTRA_CONF"
40+
3641
sh -c "$docker_run"

0 commit comments

Comments
 (0)