Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
kojix2 committed Sep 7, 2024
1 parent c654a93 commit 1996e35
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 30 deletions.
27 changes: 0 additions & 27 deletions .github/workflows/main.yml

This file was deleted.

34 changes: 34 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: test

on: [push, pull_request, workflow_dispatch]

jobs:
build:
runs-on: ${{ matrix.os }}-latest
name: ${{ matrix.os }} ruby ${{ matrix.ruby }}
strategy:
matrix:
os: [ubuntu, macos]
ruby: [3.2, 3.3]

steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- if: matrix.os == 'ubuntu'
name: Install hdf5 - Ubuntu
run: sudo apt-get install libhdf5-dev
- if: matrix.os == 'macos'
name: Install hdf5 - MacOS
run: brew install hdf5@1.10
- if: matrix.os == 'ubuntu'
name: Run test - Ubuntu
run: bundle exec rake test
- if: matrix.os == 'macos'
name: Run test - MacOS
run: bundle exec rake test
env:
HDF5_LIB_PATH: /opt/homebrew/Cellar/hdf5@1.10/1.10.11/lib
5 changes: 2 additions & 3 deletions lib/hdf5.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ class Error < StandardError; end
class << self
attr_accessor :lib_path

def search_hdf5lib(name = nil)
return File.expand_path(name, ENV['HDF5_LIB_PATH']) if ENV['HDF5_LIB_PATH']

def search_hdf5lib
name = "libhdf5.#{FFI::Platform::LIBSUFFIX}"
return File.expand_path(name, ENV['HDF5_LIB_PATH']) if ENV['HDF5_LIB_PATH']

begin
require 'pkg-config'
Expand Down

0 comments on commit 1996e35

Please # to comment.