Skip to content

Commit

Permalink
Move ci pipeline to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
xijo committed Oct 29, 2024
1 parent 6a71bc0 commit f4fffc0
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 21 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CI

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: [ '3.0', '3.1', '3.2', '3.3', 'jruby-9.4' ]

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true

- name: Update Bundler
run: gem install bundler

- name: Install dependencies
run: bundle install

- name: Run tests
run: bundle exec rspec
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ruby 3.3.5
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion reverse_markdown.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ Gem::Specification.new do |s|
s.add_development_dependency 'simplecov'
s.add_development_dependency 'rake'
s.add_development_dependency 'kramdown'
s.add_development_dependency 'debug'
s.add_development_dependency 'debug' unless RUBY_ENGINE == 'jruby'
s.add_development_dependency 'codeclimate-test-reporter'
end
3 changes: 2 additions & 1 deletion spec/lib/reverse_markdown_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@

describe 'force_encoding option', jruby: :exclude do
it 'raises invalid byte sequence in UTF-8 exception' do
expect { ReverseMarkdown.convert("hi \255") }.to raise_error(Encoding::CompatibilityError)
# Older versions of ruby used to raise ArgumentError here. Remove when we drop support for 3.1.
expect { ReverseMarkdown.convert("hi \255") }.to raise_error { [Encoding::CompatibilityError, ArgumentError].include?(_1.class) }
end

it 'handles invalid byte sequence if option is set' do
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'simplecov'
require 'debug'
require 'debug' unless RUBY_ENGINE == 'jruby'

SimpleCov.profiles.define 'gem' do
add_filter '/spec/'
Expand Down

0 comments on commit f4fffc0

Please sign in to comment.