Skip to content
Closed
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
11 changes: 11 additions & 0 deletions .github/workflows/danger-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Danger Comment

on:
workflow_run:
workflows: [Danger]
types: [completed]

jobs:
comment:
uses: numbata/danger-pr-comment/.github/workflows/danger-comment.yml@v0.1.0
secrets: inherit
13 changes: 13 additions & 0 deletions .github/workflows/danger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Danger

on:
pull_request:
types: [opened, reopened, edited, synchronize]

jobs:
danger:
uses: numbata/danger-pr-comment/.github/workflows/danger-run.yml@v0.1.0
secrets: inherit
with:
ruby-version: '3.4'
bundler-cache: true
126 changes: 126 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
name: Test

on:
push:
branches:
- master
- develop
pull_request:

jobs:
rubocop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '2.5'
bundler-cache: true
env:
BUNDLE_GEMFILE: gemfiles/rails-5.2-mongo.gemfile
- run: bundle exec rubocop

test:
runs-on: ubuntu-latest
services:
mongodb:
image: mongo:3.6
ports:
- 27017:27017
strategy:
fail-fast: false
matrix:
ruby:
- '2.1'
- '2.3'
- '2.4'
- '2.5'
- '2.6'
gemfile:
- gemfiles/rails-4.0-mongo.gemfile
- gemfiles/rails-4.0-mongoid.gemfile
- gemfiles/rails-4.1-mongo.gemfile
- gemfiles/rails-4.1-mongoid.gemfile
- gemfiles/rails-4.2-mongo.gemfile
- gemfiles/rails-4.2-mongoid.gemfile
- gemfiles/rails-5.0-mongo.gemfile
- gemfiles/rails-5.0-mongoid.gemfile
- gemfiles/rails-5.1-mongo.gemfile
- gemfiles/rails-5.1-mongoid.gemfile
- gemfiles/rails-5.2-mongo.gemfile
- gemfiles/rails-5.2-mongoid.gemfile
- gemfiles/rails-6.0-mongo.gemfile
- gemfiles/rails-6.0-mongoid.gemfile
exclude:
# Ruby 2.1 - exclude Rails 5.0+
- ruby: '2.1'
gemfile: gemfiles/rails-5.0-mongo.gemfile
- ruby: '2.1'
gemfile: gemfiles/rails-5.0-mongoid.gemfile
- ruby: '2.1'
gemfile: gemfiles/rails-5.1-mongo.gemfile
- ruby: '2.1'
gemfile: gemfiles/rails-5.1-mongoid.gemfile
- ruby: '2.1'
gemfile: gemfiles/rails-5.2-mongo.gemfile
- ruby: '2.1'
gemfile: gemfiles/rails-5.2-mongoid.gemfile
- ruby: '2.1'
gemfile: gemfiles/rails-6.0-mongo.gemfile
- ruby: '2.1'
gemfile: gemfiles/rails-6.0-mongoid.gemfile
# Ruby 2.3 - exclude Rails 6.0
- ruby: '2.3'
gemfile: gemfiles/rails-6.0-mongo.gemfile
- ruby: '2.3'
gemfile: gemfiles/rails-6.0-mongoid.gemfile
# Ruby 2.4 - exclude Rails 4.0, 4.1, and 6.0
- ruby: '2.4'
gemfile: gemfiles/rails-4.0-mongo.gemfile
- ruby: '2.4'
gemfile: gemfiles/rails-4.0-mongoid.gemfile
- ruby: '2.4'
gemfile: gemfiles/rails-4.1-mongo.gemfile
- ruby: '2.4'
gemfile: gemfiles/rails-4.1-mongoid.gemfile
- ruby: '2.4'
gemfile: gemfiles/rails-6.0-mongo.gemfile
- ruby: '2.4'
gemfile: gemfiles/rails-6.0-mongoid.gemfile
# Ruby 2.5 - exclude Rails 4.0, 4.1, 4.2
- ruby: '2.5'
gemfile: gemfiles/rails-4.0-mongo.gemfile
- ruby: '2.5'
gemfile: gemfiles/rails-4.0-mongoid.gemfile
- ruby: '2.5'
gemfile: gemfiles/rails-4.1-mongo.gemfile
- ruby: '2.5'
gemfile: gemfiles/rails-4.1-mongoid.gemfile
- ruby: '2.5'
gemfile: gemfiles/rails-4.2-mongo.gemfile
- ruby: '2.5'
gemfile: gemfiles/rails-4.2-mongoid.gemfile
# Ruby 2.6 - exclude Rails 4.0, 4.1, 4.2
- ruby: '2.6'
gemfile: gemfiles/rails-4.0-mongo.gemfile
- ruby: '2.6'
gemfile: gemfiles/rails-4.0-mongoid.gemfile
- ruby: '2.6'
gemfile: gemfiles/rails-4.1-mongo.gemfile
- ruby: '2.6'
gemfile: gemfiles/rails-4.1-mongoid.gemfile
- ruby: '2.6'
gemfile: gemfiles/rails-4.2-mongo.gemfile
- ruby: '2.6'
gemfile: gemfiles/rails-4.2-mongoid.gemfile
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
- run: bundle exec rake test
env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
8 changes: 4 additions & 4 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ Style/StringLiterals:
Style/StringLiteralsInInterpolation:
EnforcedStyle: double_quotes

Style/AlignParameters:
Layout/ParameterAlignment:
EnforcedStyle: with_fixed_indentation

Style/MultilineOperationIndentation:
Layout/MultilineOperationIndentation:
EnforcedStyle: indented

Style/AlignHash:
Layout/HashAlignment:
EnforcedLastArgumentHashStyle: ignore_implicit

Style/HashSyntax:
EnforcedStyle: hash_rockets

Style/IndentArray:
Layout/FirstArrayElementIndentation:
EnforcedStyle: consistent

Style/FormatString:
Expand Down
109 changes: 0 additions & 109 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## (unreleased)

* [#48](https://github.com/mongoid/mongo_session_store/pull/48): Migrate Danger to danger-pr-comment - [@dblock](https://github.com/dblock).
* Your contribution here.

## 3.2.1
Expand Down
6 changes: 5 additions & 1 deletion Dangerfile
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
danger.import_dangerfile(gem: "mongoid-danger")
# frozen_string_literal: true

danger.import_dangerfile(gem: 'danger-pr-comment')

changelog.check!
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
source "https://rubygems.org"

gemspec

gem "rubocop", "1.84.1"
32 changes: 25 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ MongoSessionStore is a [Rails][rails]-compatible session store for
Driver][mongo]. It also allows for custom Mongo session store that works with
any (or no!) Mongo ODM.

MongoSessionStore version 3 is compatible with Rails 4.0 through 5.2. For Rails
MongoSessionStore version 3 is compatible with Rails 5.0+. For Rails
3 support please check out issue [#17][issue-rails3] for options and let us
know if you need support.

Expand Down Expand Up @@ -70,24 +70,28 @@ MongoStore::Session.where("updated_at" => { "$gt" => 2.days.ago })

## Development

### Test environment

Start MongoDB with this script:

```
script/testenv
```

### Testing

To run the tests for a specific store. You must first set a `BUNDLE_GEMFILE` in
the environment.

You can also use Docker, see the section below this one.

```sh
bundle exec rake
```

Examples:

```sh
BUNDLE_GEMFILE=gemfiles/rails-4.0-mongo.gemfile bundle exec rake
BUNDLE_GEMFILE=gemfiles/rails-4.0-mongoid.gemfile bundle exec rake
BUNDLE_GEMFILE=gemfiles/rails-4.1-mongo.gemfile bundle exec rake
BUNDLE_GEMFILE=gemfiles/rails-4.1-mongoid.gemfile bundle exec rake
BUNDLE_GEMFILE=gemfiles/rails-4.2-mongo.gemfile bundle exec rake
BUNDLE_GEMFILE=gemfiles/rails-4.2-mongoid.gemfile bundle exec rake
BUNDLE_GEMFILE=gemfiles/rails-5.0-mongo.gemfile bundle exec rake
BUNDLE_GEMFILE=gemfiles/rails-5.0-mongoid.gemfile bundle exec rake
BUNDLE_GEMFILE=gemfiles/rails-5.1-mongo.gemfile bundle exec rake
Expand All @@ -98,6 +102,20 @@ BUNDLE_GEMFILE=gemfiles/rails-6.0-mongo.gemfile bundle exec rake
BUNDLE_GEMFILE=gemfiles/rails-6.0-mongoid.gemfile bundle exec rake
```

#### Docker testing

To run tests in a Docker container with a specific Ruby version and gemfile:

```sh
BUNDLE_GEMFILE=gemfiles/rails-6.0-mongo.gemfile script/test
```

The `BUNDLE_GEMFILE` environment variable is required. Ruby version defaults to 3.4 but can be customized:

```sh
RUBY_VERSION=2.7 BUNDLE_GEMFILE=gemfiles/rails-6.0-mongo.gemfile script/test
```

### Performance benchmark

The repository includes a performance benchmark. It runs against all available
Expand Down
5 changes: 5 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
services:
mongodb:
image: mongo:3.6
ports:
- "27017:27017"
9 changes: 0 additions & 9 deletions gemfiles/rails-4.0-mongo.gemfile

This file was deleted.

9 changes: 0 additions & 9 deletions gemfiles/rails-4.0-mongoid.gemfile

This file was deleted.

Loading
Loading