diff --git a/.github/workflows/mysql5712.yml b/.github/workflows/mysql5712.yml new file mode 100644 index 00000000..0336ea04 --- /dev/null +++ b/.github/workflows/mysql5712.yml @@ -0,0 +1,22 @@ +name: MySQL 5.7.12 (Aurora version) +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.19 + + - name: Deploy MySQL + run: scripts/dbdeployer_install_5712.sh + + - name: Test + run: MYSQL_DSN="msandbox:msandbox@tcp(127.0.0.1:5712)/test" go test -v ./... diff --git a/scripts/dbdeployer_install_5712.sh b/scripts/dbdeployer_install_5712.sh new file mode 100755 index 00000000..940b45c9 --- /dev/null +++ b/scripts/dbdeployer_install_5712.sh @@ -0,0 +1,20 @@ +#!/bin/bash +set -xe + +sudo apt install -y libncurses5 + +go install github.com/datacharmer/dbdeployer@latest + +dbdeployer init + +wget https://downloads.mysql.com/archives/get/p/23/file/mysql-5.7.12-linux-glibc2.5-x86_64.tar.gz +dbdeployer unpack mysql-5.7.12-linux-glibc2.5-x86_64.tar.gz +dbdeployer deploy single 5.7.12 + +# For spirit to work, binary logging must be enabled. +# It is not by default in MySQL 5.7 + +echo "log-bin" >> ~/sandboxes/msb_5_7_12/my.sandbox.cnf +echo "server-id=123" >> ~/sandboxes/msb_5_7_12/my.sandbox.cnf + +~/sandboxes/msb_5_7_12/restart