Skip to content

Commit a1d9b59

Browse files
authored
Merge pull request #64 from mishina2228/migrate-to-gh-actions
Migrate CI from Travis to GitHub Actions
2 parents 5031c12 + 300b7a3 commit a1d9b59

File tree

7 files changed

+38
-31
lines changed

7 files changed

+38
-31
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: CI
2+
on:
3+
pull_request:
4+
push: { branches: master }
5+
permissions:
6+
contents: read
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
ruby-version: ['2.3', '2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2', 'ruby-head']
14+
continue-on-error: ${{ matrix.ruby-version == 'ruby-head' }}
15+
steps:
16+
- uses: actions/checkout@v3
17+
- name: Set up Ruby ${{ matrix.ruby-version }}
18+
uses: ruby/setup-ruby@v1
19+
with:
20+
ruby-version: ${{ matrix.ruby-version }}
21+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
22+
- name: Run Tests
23+
run: bundle exec rake test

.travis.yml

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

Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ source 'https://rubygems.org'
44
gemspec
55

66
# TODO: add to gemspec
7-
gem "bundler", "~> 1.11"
8-
gem "rake", "~> 12.0"
7+
gem "bundler", ">= 1.11"
8+
gem "rake", ">= 12.0"
99

1010
gem 'byebug', group: %i[development test] if !Gem.win_platform? && RUBY_ENGINE == "ruby"
1111

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,6 @@ RDoc::Task.new do |rdoc|
7676
rdoc.rdoc_files.include("bin/*.rb")
7777
rdoc.rdoc_files.include("lib/**/*.rb")
7878
extra_files.each { |file|
79-
rdoc.rdoc_files.include(file) if File.exists?(file)
79+
rdoc.rdoc_files.include(file) if File.exist?(file)
8080
}
8181
end

lib/net/scp/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Net
2-
module SCP
2+
class SCP
33
# A class for describing the current version of a library. The version
44
# consists of three parts: the +major+ number, the +minor+ number, and the
55
# +tiny+ (or +patch+) number.

test/common.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
require 'test/unit'
2-
require 'mocha/setup'
2+
require 'mocha/test_unit'
33

44
begin
55
gem 'net-ssh', ">= 2.0.0"

test/test_scp.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,26 @@ class TestSCP < Net::SCP::TestCase
44
def test_start_without_block_should_return_scp_instance
55
ssh = stub('session', :logger => nil)
66
Net::SSH.expects(:start).
7-
with("remote.host", "username", :password => "foo").
7+
with("remote.host", "username", { :password => "foo" }).
88
returns(ssh)
99

1010
ssh.expects(:close).never
11-
scp = Net::SCP.start("remote.host", "username", :password => "foo")
11+
scp = Net::SCP.start("remote.host", "username", { :password => "foo" })
1212
assert_instance_of Net::SCP, scp
1313
assert_equal ssh, scp.session
1414
end
1515

1616
def test_start_with_block_should_yield_scp_and_close_ssh_session
1717
ssh = stub('session', :logger => nil)
1818
Net::SSH.expects(:start).
19-
with("remote.host", "username", :password => "foo").
19+
with("remote.host", "username", { :password => "foo" }).
2020
returns(ssh)
2121

2222
ssh.expects(:loop)
2323
ssh.expects(:close)
2424

2525
yielded = false
26-
Net::SCP.start("remote.host", "username", :password => "foo") do |scp|
26+
Net::SCP.start("remote.host", "username", { :password => "foo" }) do |scp|
2727
yielded = true
2828
assert_instance_of Net::SCP, scp
2929
assert_equal ssh, scp.session
@@ -34,26 +34,26 @@ def test_start_with_block_should_yield_scp_and_close_ssh_session
3434

3535
def test_self_upload_should_instatiate_scp_and_invoke_synchronous_upload
3636
scp = stub('scp')
37-
scp.expects(:upload!).with("/path/to/local", "/path/to/remote", :recursive => true)
37+
scp.expects(:upload!).with("/path/to/local", "/path/to/remote", { :recursive => true })
3838

3939
Net::SCP.expects(:start).
40-
with("remote.host", "username", :password => "foo").
40+
with("remote.host", "username", { :password => "foo" }).
4141
yields(scp)
4242

4343
Net::SCP.upload!("remote.host", "username", "/path/to/local", "/path/to/remote",
44-
:ssh => { :password => "foo" }, :recursive => true)
44+
{ :ssh => { :password => "foo" }, :recursive => true })
4545
end
4646

4747
def test_self_download_should_instatiate_scp_and_invoke_synchronous_download
4848
scp = stub('scp')
49-
scp.expects(:download!).with("/path/to/remote", "/path/to/local", :recursive => true).returns(:result)
49+
scp.expects(:download!).with("/path/to/remote", "/path/to/local", { :recursive => true }).returns(:result)
5050

5151
Net::SCP.expects(:start).
52-
with("remote.host", "username", :password => "foo").
52+
with("remote.host", "username", { :password => "foo" }).
5353
yields(scp)
5454

5555
result = Net::SCP.download!("remote.host", "username", "/path/to/remote", "/path/to/local",
56-
:ssh => { :password => "foo" }, :recursive => true)
56+
{ :ssh => { :password => "foo" }, :recursive => true })
5757

5858
assert_equal :result, result
5959
end

0 commit comments

Comments
 (0)