Skip to content

Commit

Permalink
Merge pull request #650 from casperisfine/github-actions
Browse files Browse the repository at this point in the history
Migrate to GitHub Actions
  • Loading branch information
byroot authored Aug 24, 2021
2 parents 577cf01 + 58dc395 commit a8e9542
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 22 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI
on: [push, pull_request]
jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: [ '2.7', '3.0', 'head' ]
rails: [ '6.0', '6.1', 'edge' ]
include:
- ruby: '2.6'
rails: '5.2'
- ruby: '2.6'
rails: '6.0'
- ruby: '2.6'
rails: '6.1'

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

steps:
- uses: actions/checkout@v2

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true

- name: Run unit tests
run: bundle exec rake test:unit
timeout-minutes: 3

- name: Run unit tests
run: bundle exec rake test:unit
timeout-minutes: 3

- name: Run acceptance tests
run: bundle exec rake test:acceptance
timeout-minutes: 10
if: ${{ matrix.rails != 'edge' && matrix.ruby != 'head' }} # Acceptance tests use `gem install rails && rails new`
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ source 'https://rubygems.org'
# Specify your gem's dependencies in spring.gemspec
gemspec

if ENV["RAILS_VERSION"]
if ENV["RAILS_VERSION"] == "edge"
gem "activesupport", github: "rails/rails", branch: "main"
elsif ENV["RAILS_VERSION"]
gem "activesupport", ENV["RAILS_VERSION"]
end
6 changes: 5 additions & 1 deletion test/support/acceptance_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ class AcceptanceTest < ActiveSupport::TestCase
DEFAULT_SPEEDUP = 0.8

def rails_version
ENV['RAILS_VERSION'] || '~> 6.0.0'
if ENV['RAILS_VERSION'] == "edge"
"7.0.0.alpha"
else
'~> 6.0.0'
end
end

# Extension point for spring-watchers-listen
Expand Down
5 changes: 4 additions & 1 deletion test/support/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ def stderr
end

def log_file
@log_file ||= path("tmp/spring.log").open("w+")
@log_file ||= begin
path("tmp").mkpath
path("tmp/spring.log").open("w+")
end
end

def env
Expand Down
2 changes: 1 addition & 1 deletion test/support/watcher_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def teardown
def touch(file, mtime = nil)
options = {}
options[:mtime] = mtime if mtime
FileUtils.touch(file, options)
FileUtils.touch(file, **options)
end

def assert_stale
Expand Down

0 comments on commit a8e9542

Please sign in to comment.