Skip to content

Commit

Permalink
Merge pull request #7 from amatsuda/gha
Browse files Browse the repository at this point in the history
Travis CI  =>  GitHub Actions
  • Loading branch information
amatsuda authored Aug 11, 2021
2 parents c91c530 + 93a2df0 commit f1b9687
Showing 5 changed files with 60 additions and 10 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: build

on: [push, pull_request]

jobs:
build:
strategy:
matrix:
ruby_version: [ruby-head, '3.0', '2.7', '2.6']
rails_version: ['edge', '6.1', '6.0', '5.2']

exclude:
- ruby_version: ruby-head
rails_version: '6.0'
- ruby_version: ruby-head
rails_version: '5.2'
- ruby_version: '3.0'
rails_version: '5.2'
- ruby_version: '2.6'
rails_version: 'edge'

include:
- ruby_version: '2.5'
rails_version: '5.1'
- ruby_version: '2.5'
rails_version: '5.0'
- ruby_version: '2.5'
rails_version: '4.2'

runs-on: ubuntu-18.04

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

steps:
- uses: actions/checkout@v2

- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
bundler-cache: true
bundler: ${{ matrix.rails_version == '4.2' && '1' || 'latest' }}
continue-on-error: ${{ (matrix.ruby_version == 'ruby-head') || (matrix.allow_failures == 'true') }}

- run: bundle exec rake
continue-on-error: ${{ (matrix.ruby_version == 'ruby-head') || contains(matrix.rails_version, 'edge') || (matrix.allow_failures == 'true') }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -7,3 +7,4 @@
/spec/reports/
/tmp/
Gemfile.lock
gemfiles/*.lock
7 changes: 0 additions & 7 deletions .travis.yml

This file was deleted.

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

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
source 'https://rubygems.org'

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

if ENV['RAILS_VERSION'] == 'edge'
gem 'rails', git: 'https://github.com/rails/rails.git'
elsif ENV['RAILS_VERSION']
gem 'rails', "~> #{ENV['RAILS_VERSION']}.0"
end
6 changes: 5 additions & 1 deletion test/string_template_test.rb
Original file line number Diff line number Diff line change
@@ -4,7 +4,11 @@

class StringTemplateTest < Minitest::Test
def setup
@view = Class.new(ActionView::Base).new(ActionView::LookupContext.new(__dir__))
@view = if ActionView::VERSION::MAJOR >= 6
Class.new(ActionView::Base.with_empty_template_cache).with_view_paths([__dir__])
else
Class.new(ActionView::Base).new(ActionView::LookupContext.new(__dir__))
end
super
end

0 comments on commit f1b9687

Please sign in to comment.