Skip to content

Commit

Permalink
Merge pull request #49 from Hywan/fix-ci
Browse files Browse the repository at this point in the history
test(fix-ci): Le's begin the nightmare
  • Loading branch information
Hywan authored May 11, 2021
2 parents 0c221e8 + 0b7be13 commit 58e09c6
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 49 deletions.
40 changes: 5 additions & 35 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

strategy:
matrix:
ruby: [2.6.7, 2.7.3, 3.0.1]
ruby: ['2.6', '2.7', '3.0']
target:
- id: 'linux-amd64'
os: 'ubuntu-latest'
Expand All @@ -31,7 +31,7 @@ jobs:

# As soon as one job fails in the matrix, all the other
# in-progress jobs are canceled.
fail-fast: true
fail-fast: false

runs-on: ${{ matrix.target.os }}

Expand All @@ -49,35 +49,10 @@ jobs:

- uses: Swatinem/rust-cache@v1

- name: Cache Ruby versions
uses: actions/cache@v1
with:
path: ~/.rbenv/
key: ${{ runner.os }}-rbenv-versions

- name: Set up `rbenv`
if: matrix.target.id == 'linux-amd64'
shell: bash
run: |
export PATH="$HOME/.rbenv/bin:$PATH"
export PATH="$HOME/.rbenv/shims:$PATH"
sudo apt install rbenv
sudo apt install rubygems
- name: Set up `rbenv`
if: matrix.target.id == 'darwin-amd64'
shell: bash
run: |
export PATH="$HOME/.rbenv/bin:$PATH"
export PATH="$HOME/.rbenv/shims:$PATH"
test -d $HOME/.rbenv/bin || brew install rbenv
- name: Set up Ruby ${{ matrix.ruby }}
shell: bash
run: |
export PATH="$HOME/.rbenv/shims:$PATH"
export PATH="$HOME/.rbenv/bin:$PATH"
rbenv install --skip-existing ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}

- name: Set up just
shell: bash
Expand All @@ -88,11 +63,7 @@ jobs:
- name: Compile the library
shell: bash
run: |
export PATH="$HOME/.rbenv/shims:$PATH"
export PATH="$HOME/.rbenv/bin:$PATH"
export PATH="$HOME/.rbenv/versions/${{ matrix.ruby }}/bin:$PATH"
export PATH="$HOME/.cargo/bin:$PATH"
export GEM_HOME="$HOME/.gem"
gem install rake
gem install bundler
just build
Expand All @@ -101,6 +72,5 @@ jobs:
shell: bash
run: |
export PATH="$HOME/.cargo/bin:$PATH"
export PATH="$HOME/.rbenv/versions/${{ matrix.ruby }}/bin:$PATH"
export GEM_HOME="$HOME/.gem"
just test
5 changes: 2 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ source "https://rubygems.org"
gemspec

group :test do
gem 'minitest', '~> 5.10'
gem 'minitest-reporters', '~> 1.1'
gem 'color_pound_spec_reporter', '~> 0.0.6'
gem 'minitest', '~> 5.14'
gem 'minitest-reporters', '~> 1.4'
end
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ end
Rake::TestTask.new(test: [:bundle_install, :build_lib]) do |t|
t.libs << "tests"
t.libs << "lib"
t.test_files = FileList["tests/**/*_test.rb"]
t.test_files = FileList["tests/*_test.rb"]
end

task :default => :test
2 changes: 1 addition & 1 deletion crates/wasmer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ macro_rules! ruby_define {
#[doc(hidden)]
#[allow(non_snake_case)]
#[no_mangle]
pub extern "C" fn Init_wasmer() {
pub extern "C" fn init() {
let mut wasmer_module = Module::from_existing("Wasmer");

wasmer_module.const_set("VERSION", &RString::new_utf8(env!("CARGO_PKG_VERSION")));
Expand Down
2 changes: 1 addition & 1 deletion lib/wasmer.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'rutie'

module Wasmer
Rutie.new(:wasmer).init 'Init_wasmer', __dir__
Rutie.new(:wasmer).init 'init', __dir__
end
4 changes: 2 additions & 2 deletions tests/prelude.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

require "wasmer"
require "minitest/autorun"
require 'color_pound_spec_reporter'
require "minitest/reporters"

Minitest::Reporters.use! [ColorPoundSpecReporter.new]
Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new

ExportType = Wasmer::ExportType
Exports = Wasmer::Exports
Expand Down
9 changes: 3 additions & 6 deletions wasmer.gemspec
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)

require "wasmer"

Gem::Specification.new do |spec|
spec.name = "wasmer"
spec.version = Wasmer::VERSION
spec.authors = ["Ivan Enderlin"]
spec.email = ["ivan.enderlin@hoa-project.net"]
spec.version = "1.0.0"
spec.authors = ["Wasmer Engineering Team"]
spec.email = ["engineering@wasmer.io"]

spec.summary = "Run WebAssembly binaries."
spec.description = "Wasmer is a Ruby extension to run WebAssembly binaries."
Expand All @@ -25,5 +23,4 @@ Gem::Specification.new do |spec|
spec.add_dependency "rutie", "~> 0.0.4"
spec.add_development_dependency "bundler", "~> 2.1"
spec.add_development_dependency "rake", "~> 13.0"
spec.add_development_dependency "minitest", "~> 5.14"
end

0 comments on commit 58e09c6

Please sign in to comment.