Skip to content

Migrate to GitHub Actions #650

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

Merged
merged 1 commit into from
Aug 24, 2021
Merged
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
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