Skip to content

test

test #127

Workflow file for this run

name: Tests
on: [push, pull_request]
jobs:
test-ubuntu-ruby:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:${{matrix.mysql}}
ports:
- 3306:3306
env:
MYSQL_DATABASE: mysql2rgeo_adapter_test
MYSQL_USER: user
MYSQL_PASSWORD: password
MYSQL_ROOT_PASSWORD: password
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
env:
BUNDLE_GEMFILE: ${{matrix.gemfile}}
strategy:
matrix:
ruby: ['3.0', '2.7', '2.6', '2.5']
gemfile:
- gemfiles/ar61.gemfile
mysql: ['5.7', '8.0']
steps:
- name: Set Up Actions
uses: actions/checkout@v2
- name: Install GEOS
run: sudo apt-get install libgeos-dev
- name: Set Up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Shutdown Ubuntu MySQL (SUDO)
run: sudo service mysql stop # Shutdown the Default MySQL, "sudo" is necessary, please not remove it
- name: Create Database
run: |
mysql -uroot -h127.0.0.1 -ppassword -e 'CREATE DATABASE IF NOT EXISTS mysql2rgeo_adapter_test;'
mysql -uroot -h127.0.0.1 -ppassword -e 'CREATE DATABASE IF NOT EXISTS mysql2rgeo_tasks_test;'
- name: Run Tests
run: bundle exec rake test
env:
MYSQL_HOST: 127.0.0.1
MYSQL_PASSWORD: password