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

Switch from Travis CI to GH actions #1

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
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
67 changes: 67 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Test

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

env:
CI: "true"

jobs:
test:
runs-on: ubuntu-22.04

services:
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps port 6379 on service container to the host
- 6379:6379

strategy:
matrix:
gemfile: ['rails_5.2', 'rails_6.0', 'rails_6.1', 'rails_7.0']

ruby: ['2.4', '2.5', '2.6', '2.7', '3.0', '3.1']

exclude:
# Rails 5.2 requires Ruby < 3.0
# https://github.com/rails/rails/issues/40938
- ruby: '3.0'
gemfile: 'rails_5.2'
- ruby: '3.1'
gemfile: 'rails_5.2'
# Rails >= 6 requires Ruby >= 2.5
- ruby: '2.4'
gemfile: 'rails_6.0'
- ruby: '2.4'
gemfile: 'rails_6.1'
# Rails >= 7 requires Ruby >= 2.7
- ruby: '2.4'
gemfile: 'rails_7.0'
- ruby: '2.5'
gemfile: 'rails_7.0'
- ruby: '2.6'
gemfile: 'rails_7.0'

env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile

steps:
- uses: actions/checkout@v2

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically

- name: Run tests
run: bundle exec rake
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.6.5
3.1.3
42 changes: 0 additions & 42 deletions .travis.yml

This file was deleted.

25 changes: 10 additions & 15 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
# frozen_string_literal: true

appraise 'rails-4.2' do
gem 'activemodel', '~> 4.2.0'
gem 'activesupport', '~> 4.2.0'
end

appraise 'rails-5.0' do
gem 'activemodel', '~> 5.0.0'
gem 'activesupport', '~> 5.0.0'
end

appraise 'rails-5.1' do
gem 'activemodel', '~> 5.1.0'
gem 'activesupport', '~> 5.1.0'
end

appraise 'rails-5.2' do
gem 'activemodel', '~> 5.2.0'
gem 'activesupport', '~> 5.2.0'
Expand All @@ -24,3 +9,13 @@ appraise 'rails-6.0' do
gem 'activemodel', '~> 6.0.0'
gem 'activesupport', '~> 6.0.0'
end

appraise 'rails-6.1' do
gem 'activemodel', '~> 6.1.0'
gem 'activesupport', '~> 6.1.0'
end

appraise 'rails-7.0' do
gem 'activemodel', '~> 7.0.0'
gem 'activesupport', '~> 7.0.0'
end
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PATH
activesupport (>= 5.2)
connection_pool (>= 2)
msgpack (>= 0.5)
redis (>= 3.0)
redis (>= 3.0, < 4.7)

GEM
remote: https://rubygems.org/
Expand Down Expand Up @@ -36,7 +36,7 @@ GEM
i18n (1.8.5)
concurrent-ruby (~> 1.0)
jaro_winkler (1.5.4)
minitest (5.14.2)
minitest (5.17.0)
msgpack (1.3.3)
parallel (1.20.1)
parser (3.0.1.0)
Expand Down Expand Up @@ -70,7 +70,7 @@ GEM
simplecov (0.18.5)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov-html (0.12.2)
simplecov-html (0.12.3)
thor (1.0.1)
thread_safe (0.3.6)
tzinfo (1.2.7)
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[![Build Status](https://travis-ci.org/rpush/modis.svg?branch=master)](https://travis-ci.org/rpush/modis)
[![Code Climate](https://codeclimate.com/github/ileitch/modis/badges/gpa.svg)](https://codeclimate.com/github/ileitch/modis)
[![Test Coverage](https://codeclimate.com/github/ileitch/modis/badges/coverage.svg)](https://codeclimate.com/github/ileitch/modis)

Expand Down
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ RSpec::Core::RakeTask.new(:spec) do |spec|
spec.rspec_opts = ['--backtrace']
end

if ENV['TRAVIS'] && ENV['QUALITY'] == 'false'
if ENV['CI'] && ENV['QUALITY'] == 'false'
task default: 'spec'
elsif RUBY_VERSION > '1.9' && defined?(RUBY_ENGINE) && RUBY_ENGINE == 'ruby'
elsif defined?(RUBY_ENGINE) && RUBY_ENGINE == 'ruby'
task default: 'spec:quality'
else
task default: 'spec'
Expand Down
8 changes: 8 additions & 0 deletions gemfiles/rails_7.0.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activemodel", "~> 7.0.0"
gem "activesupport", "~> 7.0.0"

gemspec path: "../"
2 changes: 1 addition & 1 deletion lib/tasks/quality.rake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

begin
if ENV['TRAVIS']
if ENV['CI']
namespace :spec do
task cane: ['spec']
end
Expand Down
2 changes: 1 addition & 1 deletion modis.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Gem::Specification.new do |gem|

gem.add_runtime_dependency 'activemodel', '>= 5.2'
gem.add_runtime_dependency 'activesupport', '>= 5.2'
gem.add_runtime_dependency 'redis', '>= 3.0'
gem.add_runtime_dependency 'redis', '>= 3.0', '< 4.7'
gem.add_runtime_dependency 'connection_pool', '>= 2'

if defined? JRUBY_VERSION
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

unless ENV['TRAVIS']
unless ENV['CI']
begin
require './spec/support/simplecov_helper'
include SimpleCovHelper # rubocop:disable Style/MixinUsage
Expand Down
2 changes: 1 addition & 1 deletion spec/support/simplecov_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def start_simple_cov(name)

formatters = [SimpleCov::Formatter::QualityFormatter]

if ENV['TRAVIS']
if ENV['CI']
require 'codeclimate-test-reporter'

formatters << CodeClimate::TestReporter::Formatter if CodeClimate::TestReporter.run?
Expand Down