name: CI

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2.3.1
    - name: Set up JDK 1.8
      uses: actions/setup-java@v1.3.0
      with:
        java-version: 1.8
    - name: Cache Gradle packages
      uses: actions/cache@v2
      with:
        path: ~/.gradle/caches
        key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
        restore-keys: ${{ runner.os }}-gradle
    - name: Build project
      run: ./gradlew build -x test
    - name: Run tests
      run: ./gradlew test
    - name: Run codacy-coverage-reporter
      uses: codacy/codacy-coverage-reporter-action@master
      with:
        project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
    - uses: actions/upload-artifact@v1
      if: always()
      with:
        name: Test Reports
        path: build/reports

name: CI

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  test:
    runs-on: ubuntu-latest
    env:
      MYSQL_TEST_HOST: localhost
      MYSQL_TEST_PORT: 3800
      MYSQL_TEST_DB: minecraft
      MYSQL_TEST_USER: root
      MYSQL_TEST_PASSWORD: supersecrettestpassword
    steps:
    - uses: actions/checkout@v2.3.1
    - name: Set up JDK 1.8
      uses: actions/setup-java@v1.3.0
      with:
        java-version: 1.8
    - name: Cache Gradle packages
      uses: actions/cache@v2
      with:
        path: ~/.gradle/caches
        key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
        restore-keys: ${{ runner.os }}-gradle
    - name: Build project
      run: ./gradlew build -x test
    - name: Create MySQL database
      uses: mirromutth/mysql-action@v1.1
      with:
        host port: ${{ env.MYSQL_TEST_PORT }}
        container port: 3307
        character set server: 'utf8'
        collation server: 'utf8_general_ci'
        mysql version: '8.0'
        mysql database: ${{ env.MYSQL_TEST_DB }}
        mysql root password: ${{ env.MYSQL_TEST_PASSWORD }}
    - name: Run tests
      run: ./gradlew test
    - name: Run codacy-coverage-reporter
      uses: codacy/codacy-coverage-reporter-action@master
      with:
        project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
    - uses: actions/upload-artifact@v1
      if: always()
      with:
        name: Test Reports
        path: build/reports

Add step for mysql database creation
Add step for mysql database creation