From 1174d8ada06d769378160225b6772a020344cb29 Mon Sep 17 00:00:00 2001 From: Mike Kasberg Date: Thu, 26 May 2022 10:06:43 -0600 Subject: [PATCH] Actually Use GSL in CI Tests (#197) Merge pull request 197 --- .github/workflows/ci.yml | 4 +--- Gemfile | 3 +++ test/extensions/matrix_test.rb | 2 ++ test/extensions/zero_vector_test.rb | 2 ++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c234b1..033395f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,6 +19,7 @@ jobs: env: # See https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby#matrix-of-gemfiles BUNDLE_GEMFILE: ${{ matrix.gemfile }} + LOAD_GSL: ${{ matrix.gsl }} strategy: fail-fast: false matrix: @@ -54,9 +55,6 @@ jobs: with: ruby-version: ${{ matrix.ruby_version }} bundler-cache: true - - name: Install GSL Gem - if: ${{ matrix.gsl }} - run: gem install gsl - name: Run Minitest based tests run: script/test diff --git a/Gemfile b/Gemfile index 0b883d8..7609f70 100644 --- a/Gemfile +++ b/Gemfile @@ -2,3 +2,6 @@ source 'https://rubygems.org' gemspec name: 'classifier-reborn' + +# For testing with GSL support & bundle exec +gem 'gsl' if ENV['LOAD_GSL'] == 'true' diff --git a/test/extensions/matrix_test.rb b/test/extensions/matrix_test.rb index 385fb8f..e142c35 100644 --- a/test/extensions/matrix_test.rb +++ b/test/extensions/matrix_test.rb @@ -2,6 +2,8 @@ class MatrixTest < Minitest::Test def test_zero_division + skip "extensions/vector is only used by non-GSL implementation" if $GSL + matrix = Matrix[[1, 0], [0, 1]] matrix.SV_decomp end diff --git a/test/extensions/zero_vector_test.rb b/test/extensions/zero_vector_test.rb index dff079f..0ce53ad 100644 --- a/test/extensions/zero_vector_test.rb +++ b/test/extensions/zero_vector_test.rb @@ -2,6 +2,8 @@ class ZeroVectorTest < Minitest::Test def test_zero? + skip "extensions/zero_vector is only used by non-GSL implementation" if $GSL + vec0 = Vector[] vec1 = Vector[0] vec10 = Vector.elements [0] * 10