name: tests

# Run actions when pushing to the testing branch or when you create a
# PR against it
on:
  push:
    branches: [ testing ]
  pull_request:
    branches: [ testing ]

jobs:
  unittest:
    runs-on: ubuntu-latest
    container: bonfacekilz/python2-genenetwork2:latest

    steps:
    # Use v1 of checkout since v2 fails
    - name: Checkout Project
      uses: actions/checkout@v1

    # Redis is required by some of the tests
    - name: Start Redis
      run: |
        redis-server --daemonize yes

    - name: Run the unit tests
      run: |
        mkdir -p /genotype_files/genotype/json
        env GN2_PROFILE=/usr/gn2-profile TMPDIR=/tmp SERVER_PORT=5004 \
        GENENETWORK_FILES=/genotype_files/ bash bin/genenetwork2 \
        etc/default_settings.py -c -m unittest discover -v

name: tests

# Run actions when pushing to the testing branch or when you create a
# PR against it
on:
  push:
    branches: [ testing ]
  pull_request:
    branches: [ testing ]

jobs:
  unittest:
    runs-on: ubuntu-latest
    container: bonfacekilz/python2-genenetwork2:latest

    services:
      mariadb:
        image: mariadb:latest
        ports:
          - 3306:3306
        env:
          MYSQL_USER: gn2
          MYSQL_PASSWORD: mysql_password
          MYSQL_ALLOW_EMPTY_PASSWORD: yes
          MYSQL_DATABASE: db_webqtl_s
          MYSQL_ROOT_PASSWORD: mysql_password
        options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3

    steps:
    # Use v1 of checkout since v2 fails
    - name: Checkout Project
      uses: actions/checkout@v1

    # Redis is required by some of the tests
    - name: Start Redis
      run: |
        redis-server --daemonize yes

    - name: Run the unit tests
      run: |
        mkdir -p /genotype_files/genotype/json
        env GN2_PROFILE=/usr/gn2-profile TMPDIR=/tmp SERVER_PORT=5004 \
        GENENETWORK_FILES=/genotype_files/ bash bin/genenetwork2 \
        etc/default_settings.py -c -m unittest discover -v

Update github action to include mariadb service
Update github action to include mariadb service

* .github/workflows/main.yml: Add mariadb service. This makes the
build pass because somewhere(because of cyclic imports), a connection
to mariadb is required.
