From c604317cebdaeebf4eb8195a106f6cc261f05d5a Mon Sep 17 00:00:00 2001 From: Sebastian Cohnen Date: Mon, 20 May 2024 20:58:00 +0200 Subject: [PATCH] CI: Build and install gem and run simple smoke test (#304) --- .github/workflows/ci.yml | 21 +++++++++++++++++++++ test/smoke/minimal.rb | 23 +++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 test/smoke/minimal.rb diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e7fa2d..1b4781f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: @@ -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: @@ -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 diff --git a/test/smoke/minimal.rb b/test/smoke/minimal.rb new file mode 100644 index 0000000..5bccfd2 --- /dev/null +++ b/test/smoke/minimal.rb @@ -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