Skip to content

Add ruby-version to main.yml #6

Add ruby-version to main.yml

Add ruby-version to main.yml #6

Workflow file for this run

name: Ruby
on:
push:
branches:
- main
pull_request:
jobs:
build:
runs-on: ubuntu-latest
name: Ruby ${{ matrix.ruby }}
strategy:
matrix:
ruby:
- '3.1.2'
services:
postgres:
image: postgres:12.1-alpine
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-ruby@v1
with:
ruby-version: 3.1.2
bundler-cache: true
- name: Test with RSpec
env:
RAILS_ENV: "test"
DATABASE_URL: "postgres://postgres@localhost:5432/test_database_name"
RUBYOPT: "-W:no-deprecated -W:no-experimental"
run: |
bundle exec rake db:setup
bundle exec rspec