diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..4c392ba7 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,59 @@ +name: Tests + +on: [push, pull_request, workflow_dispatch] + +permissions: + contents: read # to fetch code (actions/checkout) + +jobs: + mri: + name: >- + ${{ matrix.os }} ${{ matrix.ruby }} + + runs-on: ${{ matrix.os }} + if: | + !( contains(github.event.pull_request.title, '[ci skip]') + || contains(github.event.pull_request.title, '[skip ci]')) + strategy: + fail-fast: false + matrix: + os: [ ubuntu-20.04, ubuntu-22.04, macos-12, macos-13, windows-2022 ] + ruby: [ 2.4, 2.5, 2.6, 2.7, '3.0', 3.1, 3.2, 3.3, head ] + include: + - { os: windows-2022 , ruby: ucrt } + - { os: windows-2022 , ruby: mswin } + exclude: + - { os: ubuntu-22.04 , ruby: 2.4 } + - { os: ubuntu-22.04 , ruby: 2.5 } + - { os: ubuntu-22.04 , ruby: 2.6 } + - { os: ubuntu-22.04 , ruby: 2.7 } + - { os: ubuntu-22.04 , ruby: 3.0 } + - { os: macos-12 , ruby: 2.5 } + - { os: macos-12 , ruby: 2.7 } + - { os: macos-12 , ruby: 3.1 } + - { os: macos-13 , ruby: 2.4 } + - { os: macos-13 , ruby: 2.6 } + - { os: macos-13 , ruby: '3.0' } + - { os: windows-2022 , ruby: head } + + steps: + - name: repo checkout + uses: actions/checkout@v4 + + - name: load ruby + uses: ruby/setup-ruby-pkgs@v1 + with: + ruby-version: ${{ matrix.ruby }} + apt-get: ragel + brew: ragel + rubygems: latest + bundler-cache: true # `bundle install` and cache + timeout-minutes: 10 + + - name: compile + run: bundle exec rake compile + timeout-minutes: 3 + + - name: test + timeout-minutes: 6 + run: bundle exec rake test diff --git a/Gemfile b/Gemfile index 44de1ac5..e0b20384 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,4 @@ source 'https://rubygems.org' gemspec -group :compilation do - gem 'rvm', '~> 1.11.3.9' - gem 'rake-compiler', '~> 0.7.1' -end +gem 'rake-compiler', '~> 0.7.1' diff --git a/tasks/ragel_extension_task.rb b/tasks/ragel_extension_task.rb index 6bdc333b..c02fda17 100644 --- a/tasks/ragel_extension_task.rb +++ b/tasks/ragel_extension_task.rb @@ -31,7 +31,7 @@ def define_ragel_tasks file target(machine) => [*ragel_sources(machine)] do mkdir_p(File.dirname(target(machine))) unless File.directory?(File.dirname(target(machine))) ensure_ragel_version - sh "ragel #{flags} #{lang_ragel(machine)} -o #{target(machine)}" + sh "ragel #{flags} #{lang_ragel(machine)} -I ragel -o #{target(machine)}" end file extconf => [target(machine)] if lang == 'c' diff --git a/tasks/rvm.rake b/tasks/rvm.rake deleted file mode 100644 index a7f6c986..00000000 --- a/tasks/rvm.rake +++ /dev/null @@ -1,81 +0,0 @@ -require 'rvm' - -namespace :rvm do - - RVM_RUBIES = ['ruby-1.8.6-p398', 'ruby-1.9.1-p243', 'ruby-1.9.2-p136', 'ruby-2.2.3p173'] - RVM_GEMSET_NAME = 'redcloth' - - task :setup do - unless @rvm_setup - rvm_lib_path = "#{`echo $rvm_path`.strip}/lib" - #$LOAD_PATH.unshift(rvm_lib_path) unless $LOAD_PATH.include?(rvm_lib_path) - require 'rvm' - require 'tmpdir' - @rvm_setup = true - end - end - - desc "Runs specs under each rvm ruby" - task :spec => :setup do - puts rvm_rubies.join(',') - rvm_each_rubie do - # Make sure all dependencies are installed but ignore Gemfile.lock. It - # gets confused when locked to java and running ruby and vice-versa. - STDERR << RVM.run('bundle update').stderr - - result = RVM.run("rake test") - STDOUT << result.stdout - STDERR << result.stderr - end - end - - desc "Show rubies" - task :rubies => :setup do - puts rvm_rubies.join(",") - end - - namespace :install do - task :rubies => :setup do - installed_rubies = RVM.list_strings - RVM_RUBIES.each do |rubie| - if installed_rubies.include?(rubie) - puts "info: Rubie #{rubie} already installed." - else - good_msg = "info: Rubie #{rubie} installed." - bad_msg = "Failed #{rubie} install! Check RVM logs here: #{RVM.path}/log/#{rubie}" - puts "info: Rubie #{rubie} installation inprogress. This could take awhile..." - if RVM.install(rubie,{}) - puts(good_msg) - RVM.use(rubie) - RVM.perform_set_operation(:gem, 'install', 'bundler') - RVM.reset_current! - else - abort(bad_msg) - end - end - end - end - end - - task :remove => :setup do - rvm_rubies.each { |rubie| RVM.remove(rubie) } - end -end - - -# RVM Helper Methods - -def rvm_each_rubie - rvm_rubies.each do |rubie| - RVM.use(rubie) - puts "Using #{rubie}" - yield - end -ensure - RVM.reset_current! -end - -def rvm_rubies(options={}) - RVM_RUBIES.map{ |rubie| "#{rubie}@#{RVM_GEMSET_NAME}" } -end -