Skip to content

Commit 58dc395

Browse files
committed
Migrate to GitHub Actions
1 parent 577cf01 commit 58dc395

File tree

6 files changed

+55
-22
lines changed

6 files changed

+55
-22
lines changed

.github/workflows/ci.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: CI
2+
on: [push, pull_request]
3+
jobs:
4+
tests:
5+
runs-on: ubuntu-latest
6+
strategy:
7+
fail-fast: false
8+
matrix:
9+
ruby: [ '2.7', '3.0', 'head' ]
10+
rails: [ '6.0', '6.1', 'edge' ]
11+
include:
12+
- ruby: '2.6'
13+
rails: '5.2'
14+
- ruby: '2.6'
15+
rails: '6.0'
16+
- ruby: '2.6'
17+
rails: '6.1'
18+
19+
env:
20+
RAILS_VERSION: ${{ matrix.rails }}
21+
22+
steps:
23+
- uses: actions/checkout@v2
24+
25+
- name: Set up Ruby
26+
uses: ruby/setup-ruby@v1
27+
with:
28+
ruby-version: ${{ matrix.ruby }}
29+
bundler-cache: true
30+
31+
- name: Run unit tests
32+
run: bundle exec rake test:unit
33+
timeout-minutes: 3
34+
35+
- name: Run unit tests
36+
run: bundle exec rake test:unit
37+
timeout-minutes: 3
38+
39+
- name: Run acceptance tests
40+
run: bundle exec rake test:acceptance
41+
timeout-minutes: 10
42+
if: ${{ matrix.rails != 'edge' && matrix.ruby != 'head' }} # Acceptance tests use `gem install rails && rails new`

.travis.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

Gemfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ source 'https://rubygems.org'
33
# Specify your gem's dependencies in spring.gemspec
44
gemspec
55

6-
if ENV["RAILS_VERSION"]
6+
if ENV["RAILS_VERSION"] == "edge"
7+
gem "activesupport", github: "rails/rails", branch: "main"
8+
elsif ENV["RAILS_VERSION"]
79
gem "activesupport", ENV["RAILS_VERSION"]
810
end

test/support/acceptance_test.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ class AcceptanceTest < ActiveSupport::TestCase
1212
DEFAULT_SPEEDUP = 0.8
1313

1414
def rails_version
15-
ENV['RAILS_VERSION'] || '~> 6.0.0'
15+
if ENV['RAILS_VERSION'] == "edge"
16+
"7.0.0.alpha"
17+
else
18+
'~> 6.0.0'
19+
end
1620
end
1721

1822
# Extension point for spring-watchers-listen

test/support/application.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ def stderr
2626
end
2727

2828
def log_file
29-
@log_file ||= path("tmp/spring.log").open("w+")
29+
@log_file ||= begin
30+
path("tmp").mkpath
31+
path("tmp/spring.log").open("w+")
32+
end
3033
end
3134

3235
def env

test/support/watcher_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def teardown
3333
def touch(file, mtime = nil)
3434
options = {}
3535
options[:mtime] = mtime if mtime
36-
FileUtils.touch(file, options)
36+
FileUtils.touch(file, **options)
3737
end
3838

3939
def assert_stale

0 commit comments

Comments
 (0)