From 84b350c91c94a748b8d94cc9f9705d64e8dc7213 Mon Sep 17 00:00:00 2001 From: Lars Kanis Date: Wed, 5 Jan 2022 06:38:16 +0100 Subject: [PATCH] Adjust tests for rake-compiler-dock-1.2.0 --- .github/workflows/gem-install.yml | 6 +++--- scripts/test-gem-build | 4 ---- scripts/test-gem-file-contents | 10 +++++++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/gem-install.yml b/.github/workflows/gem-install.yml index 9126e23403..290b802518 100644 --- a/.github/workflows/gem-install.yml +++ b/.github/workflows/gem-install.yml @@ -20,7 +20,7 @@ jobs: name: "cruby-package" runs-on: ubuntu-latest container: - image: "larskanis/rake-compiler-dock-mri-x86_64-linux:1.1.0" + image: "larskanis/rake-compiler-dock-mri-x86_64-linux:1.2.0" steps: - uses: actions/checkout@v2 with: @@ -111,7 +111,7 @@ jobs: plat: ["x86_64-linux", "x86_64-darwin", "x64-mingw32", "x64-mingw-ucrt"] runs-on: ubuntu-latest container: - image: "larskanis/rake-compiler-dock-mri-${{matrix.plat}}:1.1.0" + image: "larskanis/rake-compiler-dock-mri-${{matrix.plat}}:1.2.0" steps: - uses: actions/checkout@v2 with: @@ -229,7 +229,7 @@ jobs: name: "jruby-package" runs-on: ubuntu-latest container: - image: "larskanis/rake-compiler-dock-jruby:1.1.0" + image: "larskanis/rake-compiler-dock-jruby:1.2.0" steps: - uses: actions/checkout@v2 with: diff --git a/scripts/test-gem-build b/scripts/test-gem-build index eae9574989..8ad58fddc1 100755 --- a/scripts/test-gem-build +++ b/scripts/test-gem-build @@ -14,10 +14,6 @@ BUILD_NATIVE_GEM=$2 test -e /etc/os-release && cat /etc/os-release -if [[ "${BUILD_NATIVE_GEM}" != "java" ]] ; then - rvm use 3.0 # because the default ruby is 2.5 as of rake-compiler-dock 1.1.0 -fi - set -u # TODO remove this stanza once https://github.com/rake-compiler/rake-compiler-dock/pull/57 is diff --git a/scripts/test-gem-file-contents b/scripts/test-gem-file-contents index 4884be237f..ce33c676f9 100755 --- a/scripts/test-gem-file-contents +++ b/scripts/test-gem-file-contents @@ -47,7 +47,7 @@ gemspec = Dir.mktmpdir do |dir| unless system("tar -xf #{gemfile} metadata.gz") raise "could not unpack gem #{gemfile}" end - YAML.load(%x(gunzip -c metadata.gz)) + YAML.safe_load(%x(gunzip -c metadata.gz), permitted_classes: [Gem::Specification, Gem::Version, Gem::Dependency, Gem::Requirement, Time, Symbol]) end end @@ -67,10 +67,14 @@ Minitest::Reporters.use!([Minitest::Reporters::SpecReporter.new]) puts "Testing '#{gemfile}' (#{gemspec.platform})" describe File.basename(gemfile) do let(:cross_rubies_path) { File.join(File.dirname(__FILE__), "..", ".cross_rubies") } + + # Ruby versions that should be supported by the native gem depending on the platform let(:native_ruby_versions) do File.read(cross_rubies_path).split("\n").map do |line| - line.split(":").first.split(".").take(2).join(".") # ugh - end.uniq.sort + ver, plat = line.split(":") + next if plat != gemspec.platform.to_s + ver.split(".").take(2).join(".") # ugh + end.compact.uniq.sort end describe "setup" do