Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert Travis CI to GH Actions #87

Merged
merged 3 commits into from
Sep 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: CI RSpec Test

on: [push, pull_request]

jobs:
build:
name: >-
${{ matrix.ruby }}
env:
CI: true
TESTOPTS: -v
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
ruby: [2.5, 2.6, 2.7, 3.0, jruby] # truffleruby
mongoid: [7]
experimental: [false]
include:
- ruby: 2.5
mongoid: 5
experimental: false
- ruby: 2.6
mongoid: 6
experimental: false
- ruby: 2.7
mongoid: 7.0
experimental: false
- ruby: 2.7
mongoid: 7.1
experimental: false
- ruby: 2.7
mongoid: 7.2
experimental: false
- ruby: 2.7
mongoid: 7.3
experimental: false
- ruby: head
mongoid: 7
experimental: true
- ruby: jruby-head
mongoid: 7
experimental: true
# - ruby: truffleruby-head
# mongoid: 7
# experimental: true
steps:
- name: repo checkout
uses: actions/checkout@v2
- name: start mongodb
uses: supercharge/[email protected]
with:
mongodb-version: 4.4
mongodb-replica-set: rs0
- name: load ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler: 2
- name: bundle install
run: bundle install --jobs 4 --retry 3
env:
MONGOID_VERSION: ${{ matrix.mongoid }}
- name: test
timeout-minutes: 10
continue-on-error: ${{ matrix.experimental }}
run: bundle exec rake spec
env:
MONGOID_VERSION: ${{ matrix.mongoid }}
26 changes: 0 additions & 26 deletions .travis.yml

This file was deleted.

20 changes: 15 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,22 @@ group :test do
gem 'simplecov', '>= 0.9'
end

case version = ENV['MONGOID_VERSION'] || '7.0'
when /^7/
gem 'mongoid', '~> 7.0'
when /^6/
case version = ENV['MONGOID_VERSION'] || '~> 7.0'
when 'HEAD'
gem 'mongoid', github: 'mongodb/mongoid'
when '7'
gem 'mongoid', '~> 7.3'
when '7.3'
gem 'mongoid', '~> 7.3.0'
when '7.2'
gem 'mongoid', '~> 7.2.0'
when '7.1'
gem 'mongoid', '~> 7.1.0'
when '7.0'
gem 'mongoid', '~> 7.0.0'
when '6'
gem 'mongoid', '~> 6.0'
when /^5/
when '5'
gem 'mongoid', '~> 5.0'
else
gem 'mongoid', version
Expand Down
41 changes: 27 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,46 @@
# DelayedJob Mongoid backend

[![Gem Version](https://badge.fury.io/rb/delayed_job_mongoid.svg)](http://badge.fury.io/rb/delayed_job_mongoid)
[![Build Status](https://travis-ci.org/collectiveidea/delayed_job_mongoid.svg?branch=master)](https://travis-ci.org/collectiveidea/delayed_job_mongoid)
[![Code Climate](https://codeclimate.com/github/collectiveidea/delayed_job_mongoid.svg)](https://codeclimate.com/github/collectiveidea/delayed_job_mongoid)
[![Coverage Status](https://coveralls.io/repos/collectiveidea/delayed_job_mongoid/badge.svg?branch=master&service=github)](https://coveralls.io/github/collectiveidea/delayed_job_mongoid?branch=master)

[gem]: https://rubygems.org/gems/delayed_job_mongoid
[travis]: http://travis-ci.org/collectiveidea/delayed_job_mongoid
[codeclimate]: https://codeclimate.com/github/collectiveidea/delayed_job_mongoid
[coveralls]: https://coveralls.io/r/collectiveidea/delayed_job_mongoid
[![Gem Version][gem-img]][gem-url]
[![Build Status][ghactions-img]][ghactions-url]
[![Code Climate][codeclimate-img]][codeclimate-url]
[![Coverage][coveralls-img]][coveralls-url]

## Requirements

Mongoid 5 or later.
Delayed Job Mongoid supports the following dependency versions:

- Ruby 2.3+
- Mongoid 5+

For Mongoid 3 and 4, use 2.x version of this gem.

## Installation

Add the gem to your Gemfile:

gem 'delayed_job_mongoid'
```ruby
gem 'delayed_job_mongoid'
```

Create the indexes (and don't forget to do this on your production database):
Then create the indexes (don't forget to do this in production):

script/rails runner 'Delayed::Backend::Mongoid::Job.create_indexes'
```
script/rails runner 'Delayed::Backend::Mongoid::Job.create_indexes'
```

To generate `script/delayed_job`:

rails generate delayed_job
```
rails generate delayed_job
```

That's it. Use [delayed_job](http://github.com/collectiveidea/delayed_job) as normal.

[gem-img]: https://badge.fury.io/rb/delayed_job_mongoid.svg
[gem-url]: https://rubygems.org/gems/delayed_job_mongoid
[ghactions-img]: https://github.com/collectiveidea/delayed_job_mongoid/actions/workflows/test.yml/badge.svg?query=branch%3Amaster
[ghactions-url]: https://github.com/collectiveidea/delayed_job_mongoid/actions/workflows/test.yml?query=branch%3Amaster
[codeclimate-img]: https://codeclimate.com/github/collectiveidea/delayed_job_mongoid.svg
[codeclimate-url]: https://codeclimate.com/github/collectiveidea/delayed_job_mongoid
[coveralls-img]: https://coveralls.io/github/collectiveidea/delayed_job_mongoid/badge.svg?branch=master
[coveralls-url]: https://coveralls.io/github/collectiveidea/delayed_job_mongoid?branch=master
5 changes: 2 additions & 3 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Releasing Delayed::Backend::Mongoid::Job
========================================
# Releasing Delayed::Backend::Mongoid::Job

There are no particular rules about when to release delayed_job_mongoid. Release bug fixes frequently, features not so frequently and breaking API changes rarely.

Expand All @@ -12,7 +11,7 @@ bundle install
rake
```

Check that the last build succeeded in [Travis CI](https://travis-ci.org/collectiveidea/delayed_job_mongoid) for all supported platforms.
Check that the last build succeeded in [Github Actions](https://github.com/collectiveidea/delayed_job_mongoid/actions/workflows/test.yml?query=branch%3Amaster) for all supported platforms.

Check and possibly increment the version, modify [delayed_job_mongoid.gemspec](delayed_job_mongoid.gemspec).

Expand Down
2 changes: 1 addition & 1 deletion delayed_job_mongoid.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Gem::Specification.new do |spec|
spec.add_dependency 'delayed_job', ['>= 3.0', '< 5']
spec.add_dependency 'mongoid', '>= 5.0'
spec.authors = ['Chris Gaffney', 'Brandon Keepers', 'Erik Michaels-Ober']
spec.email = ['[email protected]', '[email protected]', '[email protected]']
spec.email = %w[[email protected] [email protected] [email protected]]
spec.files = %w[CHANGELOG.md CONTRIBUTING.md LICENSE.md README.md delayed_job_mongoid.gemspec] + Dir['lib/**/*.rb']
spec.homepage = 'http://github.com/collectiveidea/delayed_job_mongoid'
spec.licenses = ['MIT']
Expand Down
15 changes: 8 additions & 7 deletions spec/helper.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
require 'simplecov'
require 'coveralls'
unless defined?(JRUBY_VERSION)
require 'simplecov'
require 'coveralls'

SimpleCov.formatters = [SimpleCov::Formatter::HTMLFormatter, Coveralls::SimpleCov::Formatter]

SimpleCov.start do
add_filter '/spec/'
minimum_coverage(76.39)
SimpleCov.formatters = [SimpleCov::Formatter::HTMLFormatter, Coveralls::SimpleCov::Formatter]
SimpleCov.start do
add_filter '/spec/'
minimum_coverage(76.39)
end
end

require 'rspec'
Expand Down