1
0
Fork 0
mirror of https://github.com/thoughtbot/shoulda-matchers.git synced 2022-11-09 12:01:38 -05:00
thoughtbot--shoulda-matchers/.github/workflows/ci.yml
2022-09-15 18:05:15 -03:00

67 lines
1.8 KiB
YAML

name: Test
on:
push:
branches:
- main
paths-ignore:
- '**.md'
pull_request:
types:
- opened
- synchronize
paths-ignore:
- '**.md'
jobs:
build:
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
ports: [ '5432:5432' ]
options: --health-cmd pg_isready --health-interval 2s --health-timeout 1s --health-retries 10
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby:
- 3.1.2
- 3.0.3
- 2.7.5
- 2.6.9
appraisal:
- rails_7_0
- rails_6_1
- rails_6_0
- rails_5_2
adapter:
- sqlite3
- postgresql
exclude:
- { ruby: 3.1.2, appraisal: rails_5_2 }
- { ruby: 3.0.3, appraisal: rails_5_2 }
- { ruby: 3.0.3, appraisal: rails_7_0 }
- { ruby: 2.7.5, appraisal: rails_7_0 }
- { ruby: 2.6.9, appraisal: rails_7_0 }
env:
DATABASE_ADAPTER: ${{ matrix.adapter }}
BUNDLE_GEMFILE: gemfiles/${{ matrix.appraisal }}.gemfile
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
id: set-up-ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- uses: actions/cache@v2
with:
path: vendor/bundle
key: v1-rubygems-local-${{ runner.os }}-${{ matrix.ruby }}-${{ hashFiles(format('gemfiles/{0}.gemfile.lock', matrix.appraisal)) }}
- name: Install dependencies
run: bundle install --jobs=3 --retry=3
- name: Run Unit Tests
run: bundle exec rake spec:unit --trace
- name: Run Acceptance Tests
run: bundle exec rake spec:acceptance --trace