Skip to content

Commit

Permalink
Improved CI
Browse files Browse the repository at this point in the history
  • Loading branch information
kojix2 committed Oct 21, 2023
1 parent 2a64b4a commit 109c3ef
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 9 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ jobs:
ruby: ["3.2"]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- 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 odgi:build
- run: bundle exec rake compile
- run: bundle exec rake test
37 changes: 29 additions & 8 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,37 @@
require 'bundler/gem_tasks'
require 'rake/testtask'
require "bundler/gem_tasks"
require "rake/testtask"

Rake::TestTask.new(:test) do |t|
t.libs << 'test'
t.libs << 'lib'
t.test_files = FileList['test/**/*_test.rb']
t.libs << "test"
t.libs << "lib"
t.test_files = FileList["test/**/*_test.rb"]
end

require 'rake/extensiontask'
require "rake/extensiontask"

task build: :compile

Rake::ExtensionTask.new('odgi') do |ext|
ext.lib_dir = 'lib/odgi'
Rake::ExtensionTask.new("odgi") do |ext|
ext.lib_dir = "lib/odgi"
end

namespace :odgi do
desc "Building odgi"
task :build do
Dir.chdir("odgi") do
sh "cmake -H. -Bbuild"
sh "cmake --build build -- -j #{Etc.nprocessors}"
sh "mkdir -p ../vendor"
if File.exist?("lib/libodgi.a")
sh "cp lib/libodgi.a ../vendor"
elsif File.exist?("build/libodgi.so")
sh "cp lib/libodgi.so ../vendor"
elsif File.exist?("build/libodgi.dylib")
sh "cp lib/libodgi.dylib ../vendor"
else
sh "ls -l lib"
warn "libodgi.a or libodgi.so or libodgi.dylib not found"
end
end
end
end

0 comments on commit 109c3ef

Please sign in to comment.