Merge pull request #120 from tablecheck/rename-models #873
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: | |
rubocop: | |
runs-on: ubuntu-latest | |
env: | |
CI: true | |
TESTOPTS: "-v" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Ruby 3.2 | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.2 | |
bundler-cache: true | |
- name: Run RuboCop | |
run: bundle exec rubocop --parallel | |
test: | |
name: "${{matrix.ruby}} | |
${{matrix.gemfile || 'Gemfile'}} | |
db:${{matrix.mongodb || '6.0'}} | |
fle:${{matrix.fle && 'fle=' || ''}}${{matrix.fle || ''}} | |
top:${{matrix.topology || 'server'}} | |
os:${{matrix.os || 'ubuntu-20.04'}}" | |
env: | |
CI: true | |
TESTOPTS: '-v' | |
runs-on: ${{matrix.os || 'ubuntu-20.04'}} | |
continue-on-error: "${{matrix.experimental || false}}" | |
strategy: | |
fail-fast: false | |
matrix: | |
ruby: [ruby-2.7, ruby-3.0, ruby-3.1, ruby-3.2] | |
# TODO: Use ubuntu-latest when supported. | |
# See: https://github.com/mongodb-labs/drivers-evergreen-tools/issues/283 | |
os: ['ubuntu-20.04'] | |
topology: [server, replica_set, sharded_cluster] | |
include: | |
# TODO: OS versions | |
# - os: macos-latest | |
# ruby: ruby-3.2 | |
# - os: windows-latest | |
# ruby: ruby-3.2 | |
# Rails versions | |
- ruby: ruby-3.2 | |
gemfile: gemfiles/rails_7.1.gemfile | |
mongodb: '6.0' | |
topology: replica_set | |
- ruby: ruby-3.1 | |
gemfile: gemfiles/rails_7.1.gemfile | |
mongodb: '5.0' | |
topology: sharded_cluster | |
- ruby: ruby-3.0 | |
gemfile: gemfiles/rails_7.0.gemfile | |
mongodb: '4.4' | |
topology: server | |
- ruby: ruby-3.0 | |
gemfile: gemfiles/rails_6.1.gemfile | |
mongodb: '4.4' | |
topology: replica_set | |
- ruby: ruby-2.7 | |
gemfile: gemfiles/rails_6.1.gemfile | |
mongodb: '4.4' | |
topology: server | |
# Driver versions | |
# TODO: driver_master is broken | |
# - ruby: ruby-3.2 | |
# gemfile: gemfiles/driver_master.gemfile | |
# mongodb: '6.0' | |
# topology: replica_set | |
- ruby: ruby-3.0 | |
gemfile: gemfiles/driver_stable.gemfile | |
mongodb: '5.0' | |
topology: sharded_cluster | |
- ruby: ruby-2.7 | |
gemfile: gemfiles/driver_min.gemfile | |
mongodb: '4.4' | |
topology: replica_set | |
# BSON versions | |
# TODO: bson_master is broken | |
# - ruby: ruby-3.2 | |
# gemfile: gemfiles/bson_master.gemfile | |
# mongodb: '6.0' | |
# topology: replica_set | |
- ruby: ruby-2.7 | |
gemfile: gemfiles/bson_min.gemfile | |
mongodb: '4.4' | |
topology: replica_set | |
# JRuby | |
- ruby: jruby-9.4 | |
gemfile: gemfiles/rails_7.1.gemfile | |
mongodb: '6.0' | |
topology: replica_set | |
- ruby: jruby-9.4 | |
gemfile: gemfiles/rails_6.1.gemfile | |
mongodb: '5.0' | |
topology: server | |
# Field-Level Encryption | |
# TODO: support LIBMONGOCRYPT via path | |
- ruby: ruby-3.2 | |
gemfile: gemfiles/rails_7.1.gemfile | |
mongodb: '6.0' | |
topology: sharded_cluster | |
fle: helper | |
- ruby: ruby-3.1 | |
gemfile: gemfiles/rails_7.0.gemfile | |
mongodb: '6.0' | |
topology: replica_set | |
fle: helper | |
- ruby: ruby-2.7 | |
gemfile: gemfiles/rails_6.1.gemfile | |
mongodb: '6.0' | |
topology: server | |
fle: helper | |
steps: | |
- name: repo checkout | |
uses: actions/checkout@v3 | |
- id: start-mongodb | |
name: start mongodb | |
uses: mongodb-labs/drivers-evergreen-tools@master | |
with: | |
version: "${{matrix.mongodb || '6.0'}}" | |
topology: "${{matrix.topology || 'server'}}" | |
- name: load ruby | |
uses: ruby/setup-ruby@v1 | |
env: | |
BUNDLE_GEMFILE: "${{matrix.gemfile || 'Gemfile'}}" | |
FLE: "${{matrix.fle || ''}}" | |
with: | |
ruby-version: "${{matrix.ruby}}" | |
bundler: 2 | |
- name: bundle | |
run: bundle install --jobs 4 --retry 3 | |
env: | |
BUNDLE_GEMFILE: "${{matrix.gemfile || 'Gemfile'}}" | |
FLE: "${{matrix.fle || ''}}" | |
- name: test | |
timeout-minutes: 60 | |
continue-on-error: "${{matrix.experimental || false}}" | |
run: bundle exec rake spec | |
env: | |
BUNDLE_GEMFILE: "${{matrix.gemfile || 'Gemfile'}}" | |
FLE: "${{matrix.fle || ''}}" | |
MONGODB_URI: "${{steps.start-mongodb.outputs.cluster-uri}}" |