Skip to content

mysqバージョンを変更 #11

mysqバージョンを変更

mysqバージョンを変更 #11

Workflow file for this run

name: "gatareview-back CI"
on:
push:
jobs:
test:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0.33
ports:
- "3306:3306"
env:
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
options: >-
--health-cmd "mysqladmin ping --silent"
--health-interval 10s
--health-timeout 5s
--health-retries 10
env:
RAILS_ENV: test
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2.2'
bundler-cache: true
- name: Install dependencies
run: bundle install --jobs 4 --retry 3
- name: Copy database configuration
run: cp config/database.yml.ci config/database.yml
- name: Wait for MySQL
run: |
for i in {1..10}; do
if mysqladmin ping --host=127.0.0.1 --user="root" --silent; then
echo "MySQL is up!"
break
fi
echo "Waiting for MySQL..."
sleep 5
done
- name: Set up database
run: |
bundle exec rails db:create
bundle exec rails db:schema:load
- name: Run RSpec tests
run: bundle exec rspec
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2.2'
bundler-cache: true
- name: Install dependencies
run: bundle install --jobs 4 --retry 3
- name: Run RuboCop
run: bundle exec rubocop