Skip to content

Commit 1174d8a

Browse files
authored
Actually Use GSL in CI Tests (#197)
Merge pull request 197
1 parent 04cd0ad commit 1174d8a

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
env:
2020
# See https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby#matrix-of-gemfiles
2121
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
22+
LOAD_GSL: ${{ matrix.gsl }}
2223
strategy:
2324
fail-fast: false
2425
matrix:
@@ -54,9 +55,6 @@ jobs:
5455
with:
5556
ruby-version: ${{ matrix.ruby_version }}
5657
bundler-cache: true
57-
- name: Install GSL Gem
58-
if: ${{ matrix.gsl }}
59-
run: gem install gsl
6058
- name: Run Minitest based tests
6159
run: script/test
6260

Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@
22

33
source 'https://rubygems.org'
44
gemspec name: 'classifier-reborn'
5+
6+
# For testing with GSL support & bundle exec
7+
gem 'gsl' if ENV['LOAD_GSL'] == 'true'

test/extensions/matrix_test.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
class MatrixTest < Minitest::Test
44
def test_zero_division
5+
skip "extensions/vector is only used by non-GSL implementation" if $GSL
6+
57
matrix = Matrix[[1, 0], [0, 1]]
68
matrix.SV_decomp
79
end

test/extensions/zero_vector_test.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
class ZeroVectorTest < Minitest::Test
44
def test_zero?
5+
skip "extensions/zero_vector is only used by non-GSL implementation" if $GSL
6+
57
vec0 = Vector[]
68
vec1 = Vector[0]
79
vec10 = Vector.elements [0] * 10

0 commit comments

Comments
 (0)