.github/workflows/ci.yml
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
name: ruby-${{ matrix.ruby }} rails-${{ matrix.rails }}
strategy:
fail-fast: false
matrix:
ruby:
- '2.7'
- '2.6'
rails:
- '5.2'
- '6.0'
- '6.1'
- '7.0'
env:
BUNDLE_JOBS: 4
BUNDLE_PATH: vendor/bundle
MYSQL_PASSWORD: root
RAILS_VERSION: ${{ matrix.rails }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Update packages
run: sudo apt-get update
- name: Install Sqlite
run: sudo apt-get install libsqlite3-dev -y
if: matrix.database == 'sqlite3'
- id: cache-bundler
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ matrix.ruby }}-${{ matrix.rails }}-${{ hashFiles('friendly_id-mobility.gemspec') }}-${{ hashFiles('Gemfile') }}
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Install latest Bundler
run: gem install bundler --no-document
- name: Install dependencies
run: bundle install
- name: Run tests
run: bundle exec rake