diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index c4dfa9271d..8da6c42ab8 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1,12 +1,6 @@ name: macos -on: - push: - branches: - - master - pull_request: - branches: - - '*' +on: [push, pull_request] jobs: build: @@ -20,6 +14,7 @@ jobs: - name: Download test readline run: | sh ./download-test_readline.sh - - name: Run test - run: | - rake ci-test + - name: rake test + run: rake test + - name: rake ci-test + run: rake ci-test diff --git a/.github/workflows/ubuntu-rvm-with-irb.yml b/.github/workflows/ubuntu-rvm-with-irb.yml index 074ee2c8a0..ac84fee8fb 100644 --- a/.github/workflows/ubuntu-rvm-with-irb.yml +++ b/.github/workflows/ubuntu-rvm-with-irb.yml @@ -1,12 +1,6 @@ name: ubuntu-rvm with irb -on: - push: - branches: - - master - pull_request: - branches: - - '*' +on: [push, pull_request] jobs: build: diff --git a/.github/workflows/ubuntu-rvm.yml b/.github/workflows/ubuntu-rvm.yml index 947b5870fa..791bcf9fca 100644 --- a/.github/workflows/ubuntu-rvm.yml +++ b/.github/workflows/ubuntu-rvm.yml @@ -1,12 +1,6 @@ name: ubuntu-rvm -on: - push: - branches: - - master - pull_request: - branches: - - '*' +on: [push, pull_request] jobs: build: @@ -32,7 +26,11 @@ jobs: - name: Download test readline run: | sh ./download-test_readline.sh - - name: Run test + - name: rake test + run: | + source $HOME/.rvm/scripts/rvm + bundle exec rake test + - name: rake ci-test run: | source $HOME/.rvm/scripts/rvm bundle exec rake ci-test diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 4ab567918a..3160d9f5a6 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -1,12 +1,6 @@ name: ubuntu -on: - push: - branches: - - master - pull_request: - branches: - - '*' +on: [push, pull_request] jobs: build: @@ -27,6 +21,7 @@ jobs: - name: Download test readline run: | sh ./download-test_readline.sh - - name: Run test - run: | - rake ci-test + - name: rake test + run: rake test + - name: rake ci-test + run: rake ci-test diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index e3f6bb4b21..108d848e2b 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -1,33 +1,28 @@ name: windows -on: - push: - branches: - - master - pull_request: - branches: - - '*' +on: [push, pull_request] jobs: build: runs-on: windows-latest strategy: + fail-fast: false matrix: - ruby: [ '2.6.x', '2.5.x' ] + ruby: [ '9.9.x', '2.6.x', '2.5.x' ] steps: - - uses: actions/checkout@master - - name: Set up Ruby - uses: actions/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby }} - - name: Install dependencies - run: | - gem install bundler --no-document - bundle install - - name: Download test readline - run: | - download-test_readline.bat - shell: cmd - - name: Run test - run: | - rake ci-test + - uses: actions/checkout@master + - name: Set up Ruby + uses: MSP-Greg/actions-ruby@master + with: + ruby-version: ${{ matrix.ruby }} + - name: Install dependencies + if: matrix.ruby != '9.9.x' + run: | + gem install bundler --no-document --conservative + bundle install + - name: Download test readline + run: ./download-test_readline.ps1 + - name: rake test + run: rake test + - name: rake ci-test + run: rake ci-test diff --git a/Rakefile b/Rakefile index 47962f3fe1..47b57630c6 100644 --- a/Rakefile +++ b/Rakefile @@ -15,7 +15,7 @@ ENCODING_LIST.each_pair do |task_name, encoding| t.libs << 'test' t.libs << 'lib' t.loader = :direct - t.pattern = 'test/**/test_*.rb' + t.pattern = 'test/reline/**/test_*.rb' end end @@ -29,7 +29,7 @@ ENCODING_LIST.each_pair do |task_name, encoding| t.libs << 'lib' t.libs << 'tool/lib' t.loader = :direct - t.pattern = 'test/**/test_*.rb' + t.pattern = 'test/ext/**/test_*.rb' end end diff --git a/download-test_readline.ps1 b/download-test_readline.ps1 new file mode 100644 index 0000000000..c20c1b03aa --- /dev/null +++ b/download-test_readline.ps1 @@ -0,0 +1,45 @@ +<# Copies files from ruby/ruby/test/readline, renames + readline.so to readline.no so tests won't run on it + + Note: the file name is not reset using rake or Actions scripts +#> + +$__dir__ = $PSScriptRoot + +$wc = $(New-Object System.Net.WebClient) + +$ruby_uri = "https://raw.githubusercontent.com/ruby/ruby/master" + +function download_files($uri2, $dir, $files) { + if ( !(Test-Path -Path "$__dir__/$dir" -PathType Container)) { + New-Item -Path "$__dir__/$dir" -ItemType Directory 1> $null + } + foreach ($file in $files) { + try { + $wc.DownloadFile("$ruby_uri/$uri2/$file", "$__dir__/$dir/$file") + } catch { + Write-Host "Can't download $ruby_uri/$uri2/$file" + exit 1 + } + } +} + +$files = "helper.rb", "test_readline.rb", "test_readline_history.rb" +download_files "test/readline" "test/ext/readline" $files + +$files = "leakchecker.rb", "envutil.rb", "colorize.rb", "find_executable.rb" +download_files "tool/lib" "tool/lib" $files + +download_files "tool/lib/minitest" "tool/lib/minitest" @("unit.rb") +download_files "tool/lib/test" "tool/lib/test" @("unit.rb") + +$files = "assertions.rb", "core_assertions.rb", "parallel.rb", "testcase.rb" +download_files "tool/lib/test/unit" "tool/lib/test/unit" $files + +# below renames readline.so to readline.no +$archdir = ruby.exe -e "print RbConfig::CONFIG['archdir']" +$readline_so = "$archdir/readline" + +if (Test-Path -Path "$readline_so.so" -PathType leaf) { + Rename-Item -Path "$readline_so.so" -NewName "$readline_so.no" +}