Skip to content

Commit

Permalink
fix gemspec and add build CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jychen7 committed Jul 3, 2022
1 parent 8e004cc commit 3d18602
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 4 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build

on:
push:
tags: ["*-rc*"]
branches: [main]

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby-version:
- "2.6"
toolchain:
- "stable"
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
default: true
- name: Set LD_LIBRARY_PATH
run: echo LD_LIBRARY_PATH=$(ruby -e 'print RbConfig::CONFIG["libdir"]') >> $GITHUB_ENV
- name: Set up Cargo cache
uses: actions/cache@v3
with:
path: ~/.cargo
key: cargo-cache-${{ steps.rust-toolchain.outputs.rustc_hash }}-${{ hashFiles('ext/datafusion_ruby/Cargo.lock') }}
- name: Build
run: make build
- name: Archive Artifact
uses: actions/upload-artifact@v3
with:
path: "*.gem"
# name: "arrow-datafusion-x.y.z.gem"
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
install:
bundle install

build:
gem build *.gemspec

publish:
gem push *.gem

test:
cd ext/datafusion_ruby && rake
bundle exec rspec
Expand Down
9 changes: 5 additions & 4 deletions arrow-datafusion.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ Gem::Specification.new do |spec|

spec.summary = "Ruby bindings of Apache Arrow Datafusion"
spec.description =
"DataFusion is an extensible query execution framework, written in Rust, that uses Apache Arrow as its in-memory format."
"Ruby bindings of Apache Arrow Datafusion"
spec.license = "Apache-2.0"

spec.files = ["README.md", "#{spec.name}.gemspec", "LICENSE"]
spec.files += Dir.glob("ext/datafusion/src/**/*.rs")
spec.files += ["ext/datafusion/Rakefile", "ext/datafusion/Cargo.toml", "ext/datafusion/Cargo.lock"]
spec.files += Dir.glob("ext/datafusion_ruby/src/**/*.rs")
spec.files += ["ext/datafusion_ruby/Rakefile", "ext/datafusion_ruby/Cargo.toml", "ext/datafusion_ruby/Cargo.lock"]
spec.files += Dir.glob("lib/**/*.rb")
spec.extensions = ["ext/datafusion/Rakefile"]
spec.extensions = ["ext/datafusion_ruby/Rakefile"]

# actually a build time dependency, but that's not an option.
spec.add_runtime_dependency "rake", "> 1"
spec.required_ruby_version = ">= 2.6.0"
end

0 comments on commit 3d18602

Please sign in to comment.