diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c3c0784d..2ea48bcf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 diff --git a/Gemfile b/Gemfile index afa35d58..ceaf22d4 100644 --- a/Gemfile +++ b/Gemfile @@ -16,3 +16,9 @@ end group :numo do gem "numo-narray" end + +if defined?(JRUBY_VERSION) + gem "activerecord-jdbcsqlite3-adapter" +else + gem "sqlite3" +end diff --git a/charty.gemspec b/charty.gemspec index d4985ec1..023f2656 100644 --- a/charty.gemspec +++ b/charty.gemspec @@ -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 diff --git a/test/table/activerecord_test.rb b/test/table/activerecord_test.rb index aa26ee89..a7695025 100644 --- a/test/table/activerecord_test.rb +++ b/test/table/activerecord_test.rb @@ -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)