Skip to content

Commit

Permalink
travis -> github
Browse files Browse the repository at this point in the history
  • Loading branch information
glebm committed Jan 10, 2023
1 parent e6e2c6c commit 1b99ce0
Show file tree
Hide file tree
Showing 15 changed files with 97 additions and 98 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
on:
push:
branches: [ main ]
pull_request:
types: [ opened, synchronize ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- ruby_version: '2.7'
gemfile: rails_7_0
upload_coverage: true
- ruby_version: '2.5'
gemfile: rails_6_1
- ruby_version: '2.3'
gemfile: rails_5_0
- ruby_version: '2.3'
gemfile: rails_4_2
bundler: '1'
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
CI: 1
BUNDLE_GEMFILE: ${{ github.workspace }}/spec/gemfiles/${{ matrix.gemfile }}.gemfile
steps:
- name: "Determine whether to upload coverage"
if: ${{ env.CC_TEST_REPORTER_ID && matrix.upload_coverage }}
run: echo COVERAGE=1 >> $GITHUB_ENV
- uses: actions/checkout@v3
- name: Set up Ruby ${{ matrix.ruby_version }} and ${{ matrix.gemfile }}.gemfile
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
bundler: ${{ matrix.bundler || 'Gemfile.lock' }}
bundler-cache: true
- name: Run tests
if: ${{ !env.COVERAGE }}
run: bundle exec rspec --format d
- name: Run tests and upload coverage
uses: paambaati/[email protected]
if: ${{ env.COVERAGE }}
with:
coverageCommand: bundle exec rspec --format d
i18n-tasks:
runs-on: ubuntu-latest
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/spec/gemfiles/i18n-tasks.gemfile
steps:
- uses: actions/checkout@v3
- name: Set up Ruby and i18n-tasks.gemfile
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
bundler-cache: true
- name: Run i18n-tasks
run: bundle exec i18n-tasks health
2 changes: 1 addition & 1 deletion .simplecov
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ SimpleCov.start do
add_group 'Policies', 'app/policies'
add_group 'View models', 'app/view_models'
add_group 'Lib', 'lib/'
formatter SimpleCov::Formatter::HTMLFormatter unless ENV['TRAVIS']
formatter SimpleCov::Formatter::HTMLFormatter unless ENV['CI']
end
44 changes: 0 additions & 44 deletions .travis.yml

This file was deleted.

3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ source 'https://rubygems.org'
gemspec

gem 'rails'
gem 'i18n-tasks'

eval_gemfile './shared.gemfile'
eval_gemfile './shared.gemfile'
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Rails Email Preview [![Build Status][travis-badge]][travis] [![Test Coverage][coverage-badge]][coverage] [![Code Climate][codeclimate-badge]][codeclimate] [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/glebm/rails_email_preview?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
# Rails Email Preview [![Build Status][badge-ci]][ci] [![Test Coverage][coverage-badge]][coverage] [![Code Climate][codeclimate-badge]][codeclimate] [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/glebm/rails_email_preview?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Preview email in the browser with this Rails engine. Compatible with Rails 4.2+.

Expand Down Expand Up @@ -269,11 +269,11 @@ This project rocks and uses MIT-LICENSE.
[rep-nav-screenshot]: https://raw.github.com/glebm/rails_email_preview/master/doc/img/rep-nav.png "Email List Screenshot"
[rep-show-screenshot]: https://raw.github.com/glebm/rails_email_preview/master/doc/img/rep-show.png "Show Email Screenshot"
[rep-show-default-screenshot]: https://raw.github.com/glebm/rails_email_preview/master/doc/img/rep-show-default.png "Show Email Screenshot (default styles)"
[travis]: http://travis-ci.org/glebm/rails_email_preview
[travis-badge]: http://img.shields.io/travis/glebm/rails_email_preview.svg
[ci]: https://github.com/glebm/rails_email_preview/actions/workflows/tests.yml
[badge-ci]: https://github.com/glebm/rails_email_preview/actions/workflows/tests.yml/badge.svg
[gem]: https://rubygems.org/gems/rails_email_preview
[gem-badge]: http://img.shields.io/gem/v/rails_email_preview.svg
[codeclimate]: https://codeclimate.com/github/glebm/rails_email_preview
[codeclimate-badge]: http://img.shields.io/codeclimate/github/glebm/rails_email_preview.svg
[coverage]: https://codeclimate.com/github/glebm/rails_email_preview
[coverage-badge]: https://codeclimate.com/github/glebm/rails_email_preview/badges/coverage.svg
[codeclimate]: https://codeclimate.com/github/glebm/rails_email_preview/maintainability
[codeclimate-badge]: https://api.codeclimate.com/v1/badges/b2b4b63c3f63e316b1e4/maintainability
[coverage]: https://codeclimate.com/github/glebm/rails_email_preview/test_coverage
[coverage-badge]: https://api.codeclimate.com/v1/badges/b2b4b63c3f63e316b1e4/test_coverage
5 changes: 2 additions & 3 deletions rails_email_preview.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ Gem::Specification.new do |s|
s.add_dependency 'turbolinks'
s.add_dependency 'request_store'

s.add_development_dependency 'i18n-tasks', '>= 0.9.25'
s.add_development_dependency 'capybara', '>= 3.8.2'
s.add_development_dependency 'capybara', '>= 3.1.1'
s.add_development_dependency 'cuprite', '>= 0.10'
s.add_development_dependency 'rspec-rails', '>= 3.8.0'
s.add_development_dependency 'puma', '>= 3.12.0'
s.add_development_dependency 'puma', '>= 3.9.1'

s.version = RailsEmailPreview::VERSION
end
21 changes: 5 additions & 16 deletions shared.gemfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,16 @@
platform :rbx do
gem 'rubysl', '~> 2.0'
gem 'racc'
end

if defined?(JRUBY_VERSION)
# JRuby attempts to install v0.9.2 even though jruby's reported required version is too low for it.
gem 'i18n-tasks', '~> 0.8.7'
end


if ENV['TRAVIS']
gem 'codeclimate-test-reporter', group: :test, require: false
else
if !ENV['CI']
group :test, :development do
gem 'byebug', platform: :mri_21, require: false
gem 'coffee-rails'
end

group :development do
gem 'puma'
gem 'byebug', platform: [:mri], require: false
end
end

if ENV['COVERAGE']
group :test do
gem 'simplecov', require: false
end
end
end
3 changes: 3 additions & 0 deletions spec/gemfiles/i18n-tasks.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source 'https://rubygems.org'

gem 'i18n-tasks'
3 changes: 1 addition & 2 deletions spec/gemfiles/rails_4_2.gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
source "http://rubygems.org"
source 'https://rubygems.org'

gemspec path: '../..'
eval_gemfile '../../shared.gemfile'

gem 'rails', '~> 4.2.0'

4 changes: 2 additions & 2 deletions spec/gemfiles/rails_5_0.gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source 'http://rubygems.org'
source 'https://rubygems.org'

gemspec path: '../..'
eval_gemfile '../../shared.gemfile'

gem 'rails', '~> 5.0.2'
eval_gemfile '../../shared.gemfile'
2 changes: 1 addition & 1 deletion spec/gemfiles/rails_5_2.gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source 'http://rubygems.org'
source 'https://rubygems.org'

gemspec path: '../..'
eval_gemfile '../../shared.gemfile'
Expand Down
7 changes: 7 additions & 0 deletions spec/gemfiles/rails_6_1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
source 'https://rubygems.org'

gemspec path: '../..'
eval_gemfile '../../shared.gemfile'

gem 'rails', '~> 6.1.7'
gem 'puma', '~> 5.6.5'
7 changes: 7 additions & 0 deletions spec/gemfiles/rails_7_0.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
source 'https://rubygems.org'

gemspec path: '../..'
eval_gemfile '../../shared.gemfile'

gem 'rails', '~> 7.0.4'

20 changes: 0 additions & 20 deletions spec/i18n_keys_spec.rb

This file was deleted.

3 changes: 2 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@

Capybara.register_driver :cuprite do |app|
options = {
window_size: [800, 800]
window_size: [800, 800],
timeout: 15,
}
options[:browser_path] = browser_path if browser_path
Capybara::Cuprite::Driver.new(app, options)
Expand Down

0 comments on commit 1b99ce0

Please sign in to comment.