Merge pull request #402 from que-rb/fix-specificity-of-rails-versions… #50
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: tests | |
on: [push, pull_request] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
ruby_version: ['2.7', '3.0', '3.1', '3.2'] | |
rails_gemfile: ['6.0', '6.1', '7.0'] | |
postgres_version: ['14'] | |
include: | |
# Postgres versions | |
- { ruby_version: '3.2', rails_gemfile: '7.0', postgres_version: '9' } | |
- { ruby_version: '3.2', rails_gemfile: '7.0', postgres_version: '10' } | |
- { ruby_version: '3.2', rails_gemfile: '7.0', postgres_version: '11' } | |
- { ruby_version: '3.2', rails_gemfile: '7.0', postgres_version: '12' } | |
- { ruby_version: '3.2', rails_gemfile: '7.0', postgres_version: '13' } | |
- { ruby_version: '3.2', rails_gemfile: '7.0', postgres_version: '14' } | |
exclude: [] | |
name: "Test: Ruby ${{ matrix.ruby_version }}, Rails ${{ matrix.rails_gemfile }}, PostgreSQL ${{ matrix.postgres_version }}" | |
services: | |
db: | |
image: postgres:${{ matrix.postgres_version }} | |
env: | |
POSTGRES_HOST_AUTH_METHOD: trust | |
ports: ['5432:5432'] | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby_version }} | |
- name: Test with Rake | |
env: | |
PGHOST: 127.0.0.1 | |
PGUSER: postgres | |
BUNDLE_GEMFILE: spec/gemfiles/Gemfile-rails-${{ matrix.rails_gemfile }} | |
run: | | |
sudo apt-get -yqq install libpq-dev postgresql-client | |
createdb que-test | |
gem install bundler | |
bundle install --jobs 4 --retry 3 | |
USE_RAILS=true bundle exec rake test | |
bundle exec rake test |