From 62defbb71f94047f84a4daab3a1223917de251c6 Mon Sep 17 00:00:00 2001 From: Koza Date: Tue, 2 Jan 2024 10:53:15 +0100 Subject: [PATCH] Add github actions --- .github/workflows/test.yml | 52 ++++++++++++++++++++++++++++++++++++++ .travis.yml | 14 ---------- Rakefile | 12 +++++++++ 3 files changed, 64 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/test.yml delete mode 100644 .travis.yml create mode 100644 Rakefile diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..5628ab0 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,52 @@ +name: Test +on: + push: + branches: ['*'] + pull_request: + branches: ['*'] + +jobs: + test_ruby_versions: + runs-on: ubuntu-20.04 + + continue-on-error: ${{ matrix.allow_failures == 'allow failures' || false }} + + env: + BUNDLE_GEMFILE: "${{ matrix.gemfile }}" ### allows adding gemfile: to the matrix, bundler will automatically pick this up + + strategy: + fail-fast: false + matrix: + include: + - ruby: 1.9 + - ruby: "2.0" + - ruby: 2.1 + - ruby: 2.2 + - ruby: 2.3 + - ruby: 2.4 + - ruby: 2.5 + - ruby: 2.6 + - ruby: 2.7 + - ruby: "3.0" ### must be quoted otherwise will be treated as "3" which resolves to latest 3.x version + - ruby: 3.1 + - ruby: 3.2 + - ruby: 3.3 + - ruby: head + allow_failures: 'allow failures' + + - ruby: jruby-9.3 + - ruby: jruby-9.4 + - ruby: jruby-head + allow_failures: 'allow failures' + steps: + - uses: actions/checkout@v4 + + - name: Install ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: "${{ matrix.ruby }}" + bundler-cache: true + + - name: Run tests + run: | + bundle exec rake diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 450948d..0000000 --- a/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -language: ruby -rvm: - - 1.8 - - 1.9 - - 2.0 - - 2.1 - - 2.2 - - jruby - - rbx -matrix: - allow_failures: - - rvm: 1.8 -script: ./script/test -sudo: false \ No newline at end of file diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..e5238c9 --- /dev/null +++ b/Rakefile @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +require 'rake/testtask' + +Rake::TestTask.new do |t| + t.libs << 'test' + t.test_files = FileList['test/**/*_test.rb'] + t.verbose = false + t.warning = true +end + +task default: :test