Skip to content

Commit

Permalink
Use GitHub actions (#76)
Browse files Browse the repository at this point in the history
* Fix tests for Ruby 2.0

* Add github actions

* Drop old test running script to have only Rake for testing
  • Loading branch information
kiskoza authored Jan 26, 2024
1 parent a951228 commit 5944de6
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 39 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
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: "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
allow_failures: 'allow failures'
- ruby: 3.2
allow_failures: 'allow failures'
- ruby: 3.3
allow_failures: 'allow failures'
- ruby: head
allow_failures: 'allow failures'

- ruby: jruby-9.3
- ruby: jruby-9.4
allow_failures: 'allow failures'
- 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
14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@ gemspec

gem "rake"
gem "minitest"

if RUBY_VERSION < '2.1'
gem 'psych', '> 2.0.0'
gem 'rexml', '< 3.2.5'
end
12 changes: 12 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -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
25 changes: 0 additions & 25 deletions script/test

This file was deleted.

0 comments on commit 5944de6

Please sign in to comment.