1
0
Fork 0
mirror of https://github.com/thoughtbot/factory_bot_rails.git synced 2022-11-09 11:49:18 -05:00

Replace Travis with GitHub Actions

Pulled from 23162d4348/.github/workflows/build.yml

As with factory_bot, we're no longer running against Ruby head, since we
don't have a great way to do allowed failures.

Closes #395
This commit is contained in:
Daniel Colson 2022-02-07 19:43:12 -05:00
parent b149856be3
commit 13de8e4350
No known key found for this signature in database
GPG key ID: 88A364BBE77B1353
3 changed files with 47 additions and 35 deletions

45
.github/workflows/build.yml vendored Normal file
View file

@ -0,0 +1,45 @@
name: Build
on:
- push
- pull_request
jobs:
build:
name: Ruby ${{ matrix.ruby }} / Rails ${{ matrix.rails }}
strategy:
fail-fast: false
matrix:
ruby:
- "2.5"
- "2.6"
- "2.7"
- "3.0"
rails:
- "5.0"
- "5.1"
- "5.2"
- "6.0"
- "6.1"
exclude:
- ruby: 3.0
rails: "5.0"
- ruby: 3.0
rails: "5.1"
- ruby: 3.0
rails: "5.2"
runs-on: 'ubuntu-latest'
env:
ARUBA_TIMEOUT: 240
BUNDLE_GEMFILE: gemfiles/rails${{ matrix.rails }}.gemfile
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Setup project
run: bundle install
- name: Run test
run: bundle exec rake

View file

@ -1,33 +0,0 @@
language: ruby
env:
- ARUBA_TIMEOUT=240
cache: bundler
rvm:
- 2.5
- 2.6
- 2.7
- 3.0
- ruby-head
branches:
only:
- master
install:
- "bundle install --retry 3 --jobs 8"
script: "bundle exec rake"
gemfile:
- gemfiles/rails5.0.gemfile
- gemfiles/rails5.1.gemfile
- gemfiles/rails5.2.gemfile
- gemfiles/rails6.0.gemfile
- gemfiles/rails6.1.gemfile
matrix:
exclude:
- rvm: 3.0
gemfile: gemfiles/rails5.0.gemfile
- rvm: 3.0
gemfile: gemfiles/rails5.1.gemfile
- rvm: 3.0
gemfile: gemfiles/rails5.2.gemfile
fast_finish: true
allow_failures:
- rvm: ruby-head

View file

@ -52,7 +52,7 @@ Feature: automatically reloading factory_bot definitions
# User model edited
"""
And I run `bin/rails test` with Spring enabled
And I run `spring stop` with a clean environment
And I run `bin/spring stop` with a clean environment
Then the output should contain "1 runs, 1 assertions"
And the output should not contain "Failure:"
@ -94,7 +94,7 @@ Feature: automatically reloading factory_bot definitions
end
"""
And I run `bin/rails test` with Spring enabled
And I run `spring stop` with a clean environment
And I run `bin/spring stop` with a clean environment
Then the output should contain "1 runs, 1 assertions"
And the output should not contain "Failure:"