Skip to content

add mysql pipeline job #143

add mysql pipeline job

add mysql pipeline job #143

Workflow file for this run

name: Ruby
on:
push:
branches:
- master
pull_request:
jobs:
build:
runs-on: ubuntu-latest
name: Ruby ${{ matrix.ruby }}
strategy:
matrix:
ruby:
- '3.3.0'
database:
- postgres
- mysql
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: outboxer_developer
POSTGRES_PASSWORD: outboxer_password
POSTGRES_DB: outboxer_test
ports: ['5432:5432']
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
if: matrix.database == 'postgres'

Check failure on line 30 in .github/workflows/master.yml

View workflow run for this annotation

GitHub Actions / Ruby

Invalid workflow file

The workflow is not valid. .github/workflows/master.yml (Line: 30, Col: 9): Unexpected value 'if' .github/workflows/master.yml (Line: 44, Col: 9): Unexpected value 'if'
mysql:
image: mysql:latest
env:
MYSQL_ROOT_PASSWORD: outboxer_password
MYSQL_DATABASE: outboxer_test
MYSQL_USER: outboxer_developer
MYSQL_PASSWORD: outboxer_password
ports: ['3306:3306']
options: >-
--health-cmd='mysqladmin ping'
--health-interval=10s
--health-timeout=5s
--health-retries=5
if: matrix.database == 'mysql'
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Check Database
run: |
if [ "${{ matrix.database }}" == "postgres" ]; then
sudo apt-get -qq install -y postgresql-client
export PGPASSWORD=outboxer_password
psql -h localhost -U outboxer_developer -d outboxer_test -c 'SELECT version();'
else
sudo apt-get -qq install -y mysql-client
export MYSQL_PWD=outboxer_password
mysql -h localhost -u outboxer_developer outboxer_test -e 'SELECT VERSION();'
fi
- name: Run Database Migrations
run: |
RAILS_ENV=test bin/rake outboxer:db:migrate
- name: Run the default task
run: RAILS_ENV=test bin/rspec spec