Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run tests also on JRuby #58

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,23 @@ jobs:

runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
ruby_version:
- 2.7
- 2.6
- 2.5
- 2.4
- jruby

steps:
- uses: actions/checkout@v1

- name: Set up Ruby 2.6
uses: actions/setup-ruby@v1
- name: Set up Ruby ${{ matrix.ruby_version }}
uses: eregon/use-ruby-action@v1
with:
ruby-version: 2.6.x
ruby-version: ${{ matrix.ruby_version }}

- name: Set up Python 3.7
uses: actions/setup-python@v1
Expand All @@ -28,11 +38,16 @@ jobs:
sudo apt install build-essential libsqlite3-dev

- name: Install matplotlib
if: matrix.ruby_version != 'jruby'
run: |
pip install --user matplotlib

- name: Build and test with Rake
run: |
gem install bundler
bundle install --jobs 4 --retry 3
if [ "${{ matrix.ruby_version }}" = "jruby" ]; then
bundle install --jobs 4 --retry 3 --without matplotlib nmatrix numo
else
bundle install --jobs 4 --retry 3
fi
bundle exec rake
6 changes: 6 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,9 @@ end
group :numo do
gem "numo-narray"
end

if defined?(JRUBY_VERSION)
gem "activerecord-jdbcsqlite3-adapter"
else
gem "sqlite3"
end
1 change: 0 additions & 1 deletion charty.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,4 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "red-datasets", ">= 0.0.9"
spec.add_development_dependency "daru"
spec.add_development_dependency "activerecord"
spec.add_development_dependency "sqlite3"
end
1 change: 1 addition & 0 deletions test/table/activerecord_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def change
end

def setup
adapter_name = defined?(JRUBY_VERSION) ? "jdbcsqlite3" : "sqlite3"
TestRecord.establish_connection(adapter: "sqlite3", database: ":memory:")
TestRecordMigration.new.exec_migration(TestRecord.connection, :up)
TestRecord.create(id: 1, name: "foo", rate: 0.1)
Expand Down