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

  build:
    name: Legacy local example using ${{ matrix.topo }} on ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest]
        topo: [etcd,k8s]

    steps:

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

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

    - name: Get dependencies
      run: |
        if [ ${{matrix.os}} = "ubuntu-latest" ]; then
          sudo apt-get update
          sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata
          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
        elif [ ${{matrix.os}} = "macos-latest" ]; then
          brew install mysql@5.7 make unzip etcd curl git wget
        fi
        go mod download

    - name: Run make minimaltools
      run: |
        make minimaltools

    - name: Build
      run: |
        make build

    - name: local_example
      timeout-minutes: 30
      run: |
        export TOPO=${{matrix.topo}}
        if [ ${{matrix.os}} = "macos-latest" ]; then
          export PATH="/usr/local/opt/mysql@5.7/bin:$PATH"
        fi
        # Make sure that testing is entirely non-reliant on config
        mv config config-moved
        eatmydata -- test/legacy_local_example.sh

Add github action for legacy file
Add github action for legacy file

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