Skip to content

Commit

Permalink
Travis CI => GH Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
amatsuda committed Jul 29, 2024
1 parent 8939f67 commit ba51289
Show file tree
Hide file tree
Showing 5 changed files with 153 additions and 21 deletions.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2

updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
105 changes: 105 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: build

on:
push:
pull_request:
schedule:
- cron: '05 12 * * *'

jobs:
build:
name: Ruby ${{ matrix.ruby_version }} / Rails ${{ matrix.rails_version }} / ${{ matrix.test_framework }}
strategy:
matrix:
ruby_version: [ruby-head, '3.3', '3.2', '3.1']
rails_version: [edge, '7.1', '7.0', '6.1']
test_framework: ['test-unit', 'minitest', 'rspec']

include:
- ruby_version: '3.0'
rails_version: '7.1'
test_framework: 'test-unit'
- ruby_version: '3.0'
rails_version: '7.1'
test_framework: 'minitest'
- ruby_version: '3.0'
rails_version: '7.1'
test_framework: 'rspec'
- ruby_version: '3.0'
rails_version: '7.0'
test_framework: 'test-unit'
- ruby_version: '3.0'
rails_version: '7.0'
test_framework: 'minitest'
- ruby_version: '3.0'
rails_version: '7.0'
test_framework: 'rspec'
- ruby_version: '3.0'
rails_version: '6.1'
test_framework: 'test-unit'
- ruby_version: '3.0'
rails_version: '6.1'
test_framework: 'minitest'
- ruby_version: '3.0'
rails_version: '6.1'
test_framework: 'rspec'

- ruby_version: '2.7'
rails_version: '7.1'
test_framework: 'test-unit'
- ruby_version: '2.7'
rails_version: '7.1'
test_framework: 'minitest'
- ruby_version: '2.7'
rails_version: '7.1'
test_framework: 'rspec'
- ruby_version: '2.7'
rails_version: '7.0'
test_framework: 'test-unit'
- ruby_version: '2.7'
rails_version: '7.0'
test_framework: 'minitest'
- ruby_version: '2.7'
rails_version: '7.0'
test_framework: 'rspec'
- ruby_version: '2.7'
rails_version: '6.1'
test_framework: 'test-unit'
- ruby_version: '2.7'
rails_version: '6.1'
test_framework: 'minitest'
- ruby_version: '2.7'
rails_version: '6.1'
test_framework: 'rspec'
- ruby_version: '2.7'
rails_version: '6.0'
test_framework: 'test-unit'
- ruby_version: '2.7'
rails_version: '6.0'
test_framework: 'minitest'
- ruby_version: '2.7'
rails_version: '6.0'
test_framework: 'rspec'

env:
RAILS_VERSION: ${{ matrix.rails_version }}
TEST_FRAMEWORK: ${{ matrix.test_framework }}

runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v4

- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
rubygems: ${{ (matrix.ruby_version < '2.7' && 'default') || (matrix.ruby_version < '3' && '3.4.22') || 'latest' }}
bundler: ${{ matrix.bundler_version }}
bundler-cache: true
continue-on-error: ${{ matrix.allow_failures == 'true' }}

- uses: browser-actions/setup-chrome@v1
- run: chrome --version

- run: bundle exec rake
continue-on-error: ${{ matrix.allow_failures == 'true' }}
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

43 changes: 41 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,43 @@
source "https://rubygems.org"
# frozen_string_literal: true

source 'https://rubygems.org'

# Specify your gem's dependencies in still_life.gemspec
gemspec

if ENV['RAILS_VERSION'] == 'edge'
gem 'rails', git: 'https://github.com/rails/rails.git'
gem 'rackup'
elsif ENV['RAILS_VERSION']
gem 'rails', "~> #{ENV['RAILS_VERSION']}.0"
if ENV['RAILS_VERSION'] <= '5.0'
gem 'sqlite3', '< 1.4'
elsif (ENV['RAILS_VERSION'] <= '8') || (RUBY_VERSION < '3')
gem 'sqlite3', '< 2'
end
gem 'rackup' if ENV['RAILS_VERSION'] > '7.1'
else
gem 'rails'
end

if RUBY_VERSION < '2.7'
gem 'puma', '< 6'
else
gem 'puma'
end

gem 'nokogiri', RUBY_VERSION < '2.1' ? '~> 1.6.0' : '>= 1.7'
gem 'loofah', RUBY_VERSION < '2.5' ? '< 2.21.0' : '>= 0'
gem 'concurrent-ruby', RUBY_VERSION < '2.3' ? '~> 1.1.0' : '>= 1.2'
gem 'selenium-webdriver', RUBY_VERSION == '3.0' ? '4.9.0' : '>= 0'
gem 'webdrivers' if ENV['RAILS_VERSION'] && ENV['RAILS_VERSION'] >= '6'
gem 'net-smtp' if RUBY_VERSION >= '3.1'
gem 'jbuilder' unless ENV['API'] == '1'
gem 'mutex_m' if RUBY_VERSION >= '3.4'
gem 'base64' if RUBY_VERSION >= '3.4'
gem 'bigdecimal' if RUBY_VERSION >= '3.4'

if !ENV['TEST_FRAMEWORK'] || (ENV['TEST_FRAMEWORK'].empty?)
raise "ENV['TEST_FRAMEWORK'] was not given"
else
gem ENV['TEST_FRAMEWORK']
end
1 change: 0 additions & 1 deletion still_life.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,4 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "bundler", "~> 2.0"
spec.add_development_dependency "rake"
spec.add_development_dependency "byebug"
spec.add_development_dependency 'test-unit-rails'
end

0 comments on commit ba51289

Please sign in to comment.