name: unit
on: [push, pull_request]
jobs:

  build:
    name: Build
    runs-on: ubuntu-latest
    steps:

    - name: Set up Go
      uses: actions/setup-go@v1
      with:
        go-version: 1.12

    - name: Check out code
      uses: actions/checkout@v1

    - name: Get dependencies
      run: |
        sudo apt-get update
        sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget ant openjdk-8-jdk
        sudo service mysql stop
        sudo service etcd stop
        sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
        sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
        go mod download

    - name: Run make tools
      run: |
        make tools

    - name: unit
      run: |
        make test

name: unit
on: [push, pull_request]
jobs:

  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        name: [mysql57, mysql80, mariadb101]

    steps:
    - name: Set up Go
      uses: actions/setup-go@v1
      with:
        go-version: 1.12

    - name: Check out code
      uses: actions/checkout@v1

    - name: Get dependencies
      run: |
        sudo apt-get update

        if [ ${{matrix.name}} = "mysql57" ]; then
          sudo apt-get install -y mysql-server mysql-client
        elif [ ${{matrix.name}} = "mysql80" ]; then
          sudo apt-get remove -y mysql-server mysql-client
          sudo rm -rf /var/lib/mysql
          wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.14-1_all.deb
          echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections 
          sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config*
          sudo apt-get update
          sudo DEBIAN_FRONTEND="noninteractive" apt-get install -y mysql-server mysql-client
        elif [ ${{matrix.name}} = "mariadb101" ]; then
          sudo apt-get remove -y mysql-server mysql-client
          sudo apt install -y mariadb-server mariadb-client
          sudo bash -c "echo '/usr/sbin/mysqld { }' > /etc/apparmor.d/usr.sbin.mysqld" # https://bugs.launchpad.net/ubuntu/+source/mariadb-10.1/+bug/1806263
        fi

        sudo apt-get install -y make unzip g++ etcd curl git wget ant openjdk-8-jdk
        sudo service mysql stop
        sudo service etcd stop
        sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
        sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
        go mod download

    - name: Run make tools
      run: |
        make tools

    - name: unit
      run: |
        make test

Add matrix build for mysql
Add matrix build for mysql

Signed-off-by: Morgan Tocker <cfa41afc5ac20f7c1e01316e2d765e1ba4c4bf7a@gmail.com>
