Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Build and install gem and run simple smoke test #304

Merged
merged 1 commit into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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