Skip to content

Commit

Permalink
Merge pull request #130 from MSP-Greg/head-reline
Browse files Browse the repository at this point in the history
Convert to single workflow file, add encoding.name to test output
  • Loading branch information
aycabta authored Feb 24, 2020
2 parents 023d3cc + 1468356 commit d7cc37c
Show file tree
Hide file tree
Showing 9 changed files with 107 additions and 143 deletions.
20 changes: 0 additions & 20 deletions .github/workflows/macos.yml

This file was deleted.

103 changes: 103 additions & 0 deletions .github/workflows/reline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: CI

on: [push, pull_request]

jobs:
reline:
name: >-
reline ${{ matrix.os }} ${{ matrix.ruby }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
ruby: [ 2.7, 2.6, 2.5 ]
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Install dependencies
run: bundle install
- name: rake test
run: rake test

readline:
name: >-
readline ${{ matrix.cfg.ruby }} ${{ matrix.cfg.os }}
runs-on: ${{ matrix.cfg.os }}
strategy:
matrix:
cfg:
- { ruby: ruby-head, os: ubuntu-latest }
- { ruby: ruby-head, os: macos-latest }
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.cfg.ruby }}
- name: Install dependencies
run: bundle install
- name: Download test readline
run: ruby download-test_readline.rb
- name: rake test
run: bundle exec rake test
- name: rake ci-test
env:
TEST_READLINE_OR_RELINE: Reline
run: bundle exec rake ci-test

win32:
name: >-
readline ${{ matrix.cfg.ruby }} ${{ matrix.cfg.os }}
runs-on: ${{ matrix.cfg.os }}
strategy:
matrix:
cfg:
- { ruby: mingw, os: windows-latest }
- { ruby: mswin, os: windows-latest }
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: MSP-Greg/actions-ruby@v1
with:
ruby-version: ${{ matrix.cfg.ruby }}
- name: Download test readline
run: ruby download-test_readline.rb
- name: rake test
run: rake test
- name: rake ci-test
env:
TEST_READLINE_OR_RELINE: Reline
run: rake ci-test

irb:
name: >-
irb ${{ matrix.ruby }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
ruby: [ 'ruby-head' ]
os: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Install dependencies
run: bundle install
- name: Install reline
run: |
rake build
rake install
- name: Download ruby/irb
run: |
git clone https://github.com/ruby/irb
- name: Setup ruby/irb
run: |
cd irb
bundle install
- name: Run irb test
run: bundle exec rake test
31 changes: 0 additions & 31 deletions .github/workflows/ubuntu-with-irb.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/ubuntu-with-readline.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .github/workflows/ubuntu.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/windows-with-readline.yml

This file was deleted.

19 changes: 0 additions & 19 deletions .github/workflows/windows.yml

This file was deleted.

4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ENCODING_LIST = {

ENCODING_LIST.each_pair do |task_name, encoding|
Rake::TestTask.new(task_name) do |t|
t.ruby_opts << %Q{-I. -e "RELINE_TEST_ENCODING=Encoding.find('#{encoding.name}')"}
t.ruby_opts << %Q{-I. -e "RELINE_TEST_ENCODING=Encoding.find('#{encoding.name}') ; puts %Q{\nTest Encoding: #{encoding.name}}"}
t.libs << 'test'
t.libs << 'lib'
t.loader = :direct
Expand All @@ -24,7 +24,7 @@ task test: ENCODING_LIST.keys

ENCODING_LIST.each_pair do |task_name, encoding|
Rake::TestTask.new("ci-#{task_name}") do |t|
t.ruby_opts << %Q{-I. -e "RELINE_TEST_ENCODING=Encoding.find('#{encoding.name}')"}
t.ruby_opts << %Q{-I. -e "RELINE_TEST_ENCODING=Encoding.find('#{encoding.name}') ; puts %Q{\nTest Encoding: #{encoding.name}}"}
t.libs << 'tool'
t.libs << 'lib'
t.libs << 'tool/lib'
Expand Down
2 changes: 2 additions & 0 deletions download-test_readline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ def run
loop do
break if files.empty?
path, dir, file = files.shift
# x,y,z = [].shift => x is nil
break if path.nil?

uri = URI("#{HOST}/#{BASE}/#{path}/#{file}")
req = Net::HTTP::Get.new uri.request_uri
Expand Down

0 comments on commit d7cc37c

Please sign in to comment.