Skip to content

Commit

Permalink
Add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
kojix2 committed Oct 21, 2023
1 parent eae56dc commit 2a64b4a
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 4 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: test
on: [push, pull_request]
jobs:
build:
name: ${{ matrix.os }} Ruby ${{ matrix.ruby }}
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
os: ["ubuntu", "macos"]
ruby: ["3.2"]
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- uses: r-lib/actions/setup-r@v2
- if: matrix.os == 'ubuntu'
run: sudo apt-get update -yq && sudo apt-get upgrade -yq
- if: matrix.os == 'macos'
run: brew update && brew upgrade
- run: bundle exec rake compile
- run: bundle exec rake test
9 changes: 5 additions & 4 deletions ext/odgi/extconf.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# frozen_string_literal: true

require 'mkmf-rice'
require "mkmf-rice"

find_header('odgi.hpp', File.expand_path('../include', __dir__))
find_library('odgi', nil, File.expand_path('../../vendor', __dir__))
find_header("odgi.hpp", File.expand_path("../../odgi/src/", __dir__))
find_header("version.hpp", File.expand_path("../../odgi/src/", __dir__))
find_library("odgi", nil, File.expand_path("../../vendor", __dir__))

create_makefile('odgi/odgi')
create_makefile("odgi/odgi")
7 changes: 7 additions & 0 deletions test/odgi_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require_relative "test_helper"

class OdgiTest < Minitest::Test
def test_that_it_has_a_version_number
refute_nil ::Odgi::VERSION
end
end
4 changes: 4 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
require "bundler/setup"
Bundler.require(:default)
require "minitest/autorun"
require "minitest/pride"

0 comments on commit 2a64b4a

Please sign in to comment.