Skip to content

Commit

Permalink
CI: Build and install gem and run simple smoke test (#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
tisba committed May 20, 2024
1 parent 2c88956 commit c604317
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ jobs:
run: bundle exec rake compile
- name: Test
run: bundle exec rake test
- name: Build & Install gem
run: |
bundle exec rake build
gem uninstall --all --force mini_racer
gem install pkg/*.gem
- name: Smoke Test installed gem
run: ruby test/smoke/minimal.rb

test-darwin:
strategy:
Expand Down Expand Up @@ -68,6 +75,13 @@ jobs:
run: bundle exec rake compile
- name: Test
run: bundle exec rake test
- name: Build & Install gem
run: |
bundle exec rake build
gem uninstall --all --force mini_racer
gem install pkg/*.gem
- name: Smoke Test installed gem
run: ruby test/smoke/minimal.rb

test-linux:
strategy:
Expand Down Expand Up @@ -122,3 +136,10 @@ jobs:
run: docker exec -w "${PWD}" ${{ steps.container.outputs.container_id }} bundle exec rake compile
- name: Test
run: docker exec -w "${PWD}" ${{ steps.container.outputs.container_id }} bundle exec rake test
- name: Build & Install gem
run: |
docker exec -w "${PWD}" ${{ steps.container.outputs.container_id }} bundle exec rake build
docker exec -w "${PWD}" ${{ steps.container.outputs.container_id }} gem uninstall --all --force mini_racer
docker exec -w "${PWD}" ${{ steps.container.outputs.container_id }} gem install pkg/*.gem
- name: Smoke Test installed gem
run: docker exec -w "${PWD}" ${{ steps.container.outputs.container_id }} ruby test/smoke/minimal.rb
23 changes: 23 additions & 0 deletions test/smoke/minimal.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# frozen_string_literal: true

require "mini_racer"
require "libv8-node"
require "rbconfig"

puts "RbConfig::CONFIG['LIBS']: #{RbConfig::CONFIG["LIBS"]}"
puts "RUBY_VERSION: #{RUBY_VERSION}"
puts "RUBY_PLATFORM: #{RUBY_PLATFORM}"
puts "MiniRacer::VERSION: #{MiniRacer::VERSION}"
puts "MiniRacer::LIBV8_NODE_VERSION: #{MiniRacer::LIBV8_NODE_VERSION}"
puts "Libv8::Node::VERSION: #{Libv8::Node::VERSION}"
puts "Libv8::Node::NODE_VERSION: #{Libv8::Node::NODE_VERSION}"
puts "Libv8::Node::LIBV8_VERSION: #{Libv8::Node::LIBV8_VERSION}"
puts "=" * 80

require "minitest/autorun"

class MiniRacerFunctionTest < Minitest::Test
def test_minimal
assert_equal MiniRacer::Context.new.eval("41 + 1"), 42
end
end

0 comments on commit c604317

Please sign in to comment.