From da59e48fac3d332777cb36fc11b97ff14fd56c01 Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Sun, 19 May 2024 09:13:26 +0900 Subject: [PATCH] Add GitHub actions. (#110) - Set minimum required Ruby version to 2.5+. --- .github/workflows/test.yaml | 53 +++++++++++++++++++++++++++++++++++++ .travis.yml | 20 -------------- Gemfile | 18 ++++++++----- README.md | 4 +-- Rakefile | 14 ---------- rb-inotify.gemspec | 7 +---- 6 files changed, 66 insertions(+), 50 deletions(-) create mode 100644 .github/workflows/test.yaml delete mode 100644 .travis.yml delete mode 100644 Rakefile diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..4b9d68b --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,53 @@ +name: Test + +on: [push, pull_request] + +permissions: + contents: read + +env: + CONSOLE_OUTPUT: XTerm + +jobs: + test: + name: ${{matrix.ruby}} on ${{matrix.os}} + runs-on: ${{matrix.os}}-latest + continue-on-error: ${{matrix.experimental}} + + strategy: + matrix: + os: + - ubuntu + + ruby: + - "2.5" + - "2.6" + - "2.7" + - "3.0" + - "3.1" + - "3.2" + - "3.3" + + experimental: [false] + + include: + - os: ubuntu + ruby: truffleruby + experimental: true + - os: ubuntu + ruby: jruby + experimental: true + - os: ubuntu + ruby: head + experimental: true + + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{matrix.ruby}} + bundler-cache: true + + - name: Run tests + timeout-minutes: 10 + run: bundle exec rspec diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c9a812d..0000000 --- a/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -language: ruby -cache: bundler - -matrix: - include: - - rvm: 2.3 - - rvm: 2.4 - - rvm: 2.5 - - rvm: 2.6 - - rvm: 2.7 - - rvm: jruby - - rvm: truffleruby - - rvm: jruby-head - - rvm: ruby-head - allow_failures: - - rvm: truffleruby - - rvm: jruby - - rvm: ruby-head - - rvm: jruby-head - fast_finish: true diff --git a/Gemfile b/Gemfile index 9b2ce27..f0544e5 100644 --- a/Gemfile +++ b/Gemfile @@ -3,14 +3,18 @@ source 'https://rubygems.org' # Specify your gem's dependencies in utopia.gemspec gemspec -group :development do - gem 'pry' - gem 'pry-coolline' - - gem 'tty-prompt' +group :maintenance, optional: true do + gem "bake-gem" + gem "bake-modernize" end group :test do - gem 'simplecov' - gem 'coveralls', require: false + gem "rspec", "~> 3.6" + + gem 'simplecov' + gem 'coveralls', require: false + + gem "bundler" + gem "rake" + gem "concurrent-ruby" end diff --git a/README.md b/README.md index 90f5aa3..4cc0345 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,7 @@ It uses the [FFI](http://wiki.github.com/ffi/ffi) gem to avoid having to compile [API documentation is available on rdoc.info](http://rdoc.info/projects/nex3/rb-inotify). -[![Build Status](https://secure.travis-ci.org/guard/rb-inotify.svg)](http://travis-ci.org/guard/rb-inotify) -[![Code Climate](https://codeclimate.com/github/guard/rb-inotify.svg)](https://codeclimate.com/github/guard/rb-inotify) -[![Coverage Status](https://coveralls.io/repos/guard/rb-inotify/badge.svg)](https://coveralls.io/r/guard/rb-inotify) +[![Development Status](https://github.com/guard/rb-inotify/workflows/Test/badge.svg)](https://github.com/guard/rb-inotify/actions?workflow=Test) ## Usage diff --git a/Rakefile b/Rakefile deleted file mode 100644 index bc3a3b6..0000000 --- a/Rakefile +++ /dev/null @@ -1,14 +0,0 @@ -require "bundler/gem_tasks" -require 'rspec/core/rake_task' - -RSpec::Core::RakeTask.new(:spec) - -desc "Run tests" -task :default => :spec - -task :console do - require 'rb-inotify' - require 'pry' - - binding.pry -end diff --git a/rb-inotify.gemspec b/rb-inotify.gemspec index e83eafe..5ce4bc3 100644 --- a/rb-inotify.gemspec +++ b/rb-inotify.gemspec @@ -17,12 +17,7 @@ Gem::Specification.new do |spec| spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] - spec.required_ruby_version = '>= 2.2' + spec.required_ruby_version = '>= 2.5' spec.add_dependency "ffi", "~> 1.0" - - spec.add_development_dependency "rspec", "~> 3.6" - spec.add_development_dependency "bundler" - spec.add_development_dependency "rake" - spec.add_development_dependency "concurrent-ruby" end