Skip to content

Improve GitHub workflows #25

Improve GitHub workflows

Improve GitHub workflows #25

---
name: Specs MySQL Rails 6.1
on:
pull_request:
branches: [main]
push:
branches: [main]
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
ruby: ['3.0']
env:
DB_TEST: mysql
MYSQL_DB_HOST: 127.0.0.1
RAILS_VERSION: 6.1
services:
mysql:
image: mysql
env:
MYSQL_USER: root
MYSQL_PASSWORD: password
# options: >-
# --health-cmd="mysqladmin ping"
# --health-interval 10s
# --health-timeout 5s
# --health-retries 5
ports:
- 3306:3306
steps:
- name: Install dependencies
run: sudo apt-get update -qq && sudo apt-get install -yqq freetds-dev freetds-bin libvips-dev
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Start database service
run: sudo /etc/init.d/mysql start
- name: Database setup
run: bin/rails db:create db:migrate db:test:prepare
- name: Run tests
run: bin/rspec --profile