1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
|
name: CI
on:
push:
branches:
- 'master'
pull_request:
jobs:
test:
strategy:
matrix:
database: [ mysql, postgresql ]
gemfile: [ '8.0', '7.2', '7.1', '7.0', '6.1', '6.0' ]
ruby: [ '2.7', '3.0', '3.1', '3.2', '3.3', '3.4' ]
exclude:
- gemfile: '6.0'
ruby: '3.2'
- gemfile: '6.0'
ruby: '3.3'
- gemfile: '6.0'
ruby: '3.4'
- gemfile: '6.1'
ruby: '3.2'
- gemfile: '6.1'
ruby: '3.3'
- gemfile: '6.1'
ruby: '3.4'
- gemfile: '7.0'
ruby: '3.3'
- gemfile: '7.0'
ruby: '3.4'
- gemfile: '7.1'
ruby: '3.3'
- gemfile: '7.1'
ruby: '3.4'
- gemfile: '7.2'
ruby: '2.7'
- gemfile: '7.2'
ruby: '3.0'
- gemfile: '8.0'
ruby: '2.7'
- gemfile: '8.0'
ruby: '3.0'
- gemfile: '8.0'
ruby: '3.1'
fail-fast: false
runs-on: ubuntu-latest
env:
BUNDLE_GEMFILE: gemfiles/Gemfile.rails-${{ matrix.gemfile }}.rb
CI: true
COVERALLS: true
DB: ${{ matrix.database }}
MYSQL_PASSWORD: root
PGHOST: localhost
PGPASSWORD: runner
PGUSER: runner
RAILS_ENV: test
name: ${{ matrix.ruby }} ${{ matrix.database }} rails-${{ matrix.gemfile }}
steps:
- uses: actions/checkout@v6
- run: sudo apt-get update && sudo apt-get install libsqlite3-dev -y
- name: "Set up MySQL using VM's server"
if: ${{ env.DB == 'mysql' }}
run: |
sudo apt-get install libmysqlclient-dev -y
sudo systemctl start mysql.service
- name: "Set up PostgreSQL using VM's server"
if: ${{ env.DB == 'postgresql' }}
run: |
sudo apt-get install libpq-dev -y
sudo systemctl start postgresql.service
sudo -u postgres psql -c "CREATE USER runner WITH SUPERUSER PASSWORD 'runner'"
sudo -u postgres createdb runner
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: ${{ matrix.ruby }}
- run: bundle exec rake db:{create,up}
- run: bundle exec rake test
|