diff --git a/.github/workflows/codecheck.yml b/.github/workflows/codecheck.yml new file mode 100644 index 0000000..74e9f03 --- /dev/null +++ b/.github/workflows/codecheck.yml @@ -0,0 +1,18 @@ +name: Codecheck +on: + push: + branches: + - master + pull_request: + branches: + - master +jobs: + codecheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.7 + bundler-cache: true + - run: bundle exec rubocop \ No newline at end of file diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..bb6a602 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,30 @@ +name: Tests +on: + push: + branches: + - master + pull_request: + branches: + - master +jobs: + test: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + ruby: [2.5, 2.6, 2.7] + runs-on: ${{ matrix.os }} + + services: + mongodb: + image: mongo + ports: + - 27017:27017 + + steps: + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + - run: bundle exec rake diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b54fd58..0000000 --- a/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -language: ruby -rvm: - - 2.4 - - 2.5 - - 2.6 - - 2.7 -services: - - mongodb -before_install: - - gem update --system - - gem install bundler - - bundle update --bundler -jobs: - include: - - stage: test - script: bundle exec rake - - stage: codecheck - script: bundle exec rubocop \ No newline at end of file diff --git a/README.md b/README.md index 6097810..60feb35 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # ActiveAdmin-Mongoid [![Version ][rubygems_badge]][rubygems] -[![Build Status](https://travis-ci.org/activeadmin/activeadmin-mongoid.svg?branch=master)](https://travis-ci.org/activeadmin/activeadmin-mongoid) +![Tests](https://github.com/activeadmin/activeadmin-mongoid/actions/workflows/tests.yml/badge.svg) +![Codecheck](https://github.com/activeadmin/activeadmin-mongoid/actions/workflows/codecheck.yml/badge.svg) ## Updates diff --git a/lib/activeadmin-mongoid.rb b/lib/activeadmin-mongoid.rb index 57ddd40..36bf582 100644 --- a/lib/activeadmin-mongoid.rb +++ b/lib/activeadmin-mongoid.rb @@ -9,7 +9,6 @@ # and thereby pushing ActiveAdmin::Generators::InstallGenerator to use our empty create_migrations method. Rails::Generators::NamedBase.class_eval do - def create_migrations end @@ -17,7 +16,7 @@ def self.inherited(klass) super if klass.name == "ActiveAdmin::Generators::InstallGenerator" - klass.class_eval do + klass.class_eval do def self.method_added(method_name) super remove_method method_name if method_name == :create_migrations @@ -26,4 +25,3 @@ def self.method_added(method_name) end end end -