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

Experimenting with more Windows CI fixes #7453

Draft
wants to merge 15 commits into
base: master
Choose a base branch
from
6 changes: 3 additions & 3 deletions .github/workflows/bundler.yml
Expand Up @@ -62,12 +62,12 @@ jobs:
- name: Install graphviz (Ubuntu)
run: sudo apt-get install graphviz -y
if: matrix.bundler.value == '' && matrix.os.name == 'Ubuntu'
- name: Prepare dependencies
run: |
bin/rake spec:parallel_deps
- name: Replace version
run: BUNDLER_SPEC_SUB_VERSION=${{ matrix.bundler.value }} bin/rake override_version
if: matrix.bundler.value != ''
- name: Prepare dependencies
run: |
bin/rake spec:parallel_deps
- name: Run Test
run: |
bin/parallel_rspec
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/install-rubygems.yml
Expand Up @@ -26,7 +26,7 @@ jobs:
- { name: "3.1", value: 3.1.4 }
- { name: "3.2", value: 3.2.3 }
- { name: "3.3", value: 3.3.0 }
- { name: jruby-9.4, value: jruby-9.4.2.0 }
- { name: jruby-9.4, value: jruby-9.4.5.0 }
- { name: truffleruby-23, value: truffleruby-23.1.2 }
openssl:
- { name: "openssl", value: true }
Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
- { name: "3.1", value: 3.1.4 } # Rails 7
- { name: "3.2", value: 3.2.3 } # Rails 7
- { name: "3.3", value: 3.3.0 } # Rails 7
- { name: jruby-9.4, value: jruby-9.4.2.0, rails-args: "--skip-webpack-install" } # Rails 6
- { name: jruby-9.4, value: jruby-9.4.5.0, rails-args: "--skip-webpack-install" } # Rails 6
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup ruby
Expand All @@ -111,7 +111,7 @@ jobs:
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0
with:
distribution: temurin
java-version: 19.0.2
java-version: 21.0.2
if: startsWith(matrix.ruby.name, 'jruby')
- name: Install rubygems
run: ruby setup.rb
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/jruby-bundler.yml
Expand Up @@ -36,13 +36,13 @@ jobs:
- name: Setup ruby
uses: ruby/setup-ruby@22fdc77bf4148f810455b226c90fb81b5cbc00a7 # v1.171.0
with:
ruby-version: jruby-9.4.2.0
ruby-version: jruby-9.4.5.0
bundler: none
- name: Setup java
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0
with:
distribution: temurin
java-version: 19.0.2
java-version: 21.0.2
if: "!startsWith(matrix.os.name, 'ubuntu')"
- name: Prepare dependencies
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/realworld-bundler.yml
Expand Up @@ -49,11 +49,11 @@ jobs:
with:
ruby-version: ${{ matrix.ruby.value }}
bundler: none
- name: Prepare dependencies
run: bin/rake spec:deps
- name: Replace version
run: BUNDLER_SPEC_SUB_VERSION=${{ matrix.bundler.value }} bin/rake override_version
if: matrix.bundler.value != ''
- name: Prepare dependencies
run: bin/rake spec:deps
- name: Run Test
run: bin/rake spec:realworld
- name: Upload used cassettes as artifact
Expand Down Expand Up @@ -85,11 +85,11 @@ jobs:
with:
ruby-version: ${{ matrix.ruby.value }}
bundler: none
- name: Prepare dependencies
run: bin/rake spec:deps
- name: Replace version
run: BUNDLER_SPEC_SUB_VERSION=${{ matrix.bundler.value }} bin/rake override_version
if: matrix.bundler.value != ''
- name: Prepare dependencies
run: bin/rake spec:deps
- name: Run Test
run: bin/rake spec:realworld
- name: Upload used cassettes as artifact
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rubygems.yml
Expand Up @@ -33,7 +33,7 @@ jobs:
- { name: "3.3", value: 3.3.0 }

include:
- ruby: { name: jruby-9.4, value: jruby-9.4.2.0 }
- ruby: { name: jruby-9.4, value: jruby-9.4.5.0 }
os: { name: Ubuntu, value: ubuntu-22.04 }

- ruby: { name: truffleruby-23, value: truffleruby-23.1.2 }
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/system-rubygems-bundler.yml
Expand Up @@ -47,12 +47,12 @@ jobs:
- name: Install graphviz
run: sudo apt-get install graphviz -y
if: matrix.bundler.value == ''
- name: Prepare dependencies
run: |
bin/rake spec:parallel_deps
- name: Replace version
run: BUNDLER_SPEC_SUB_VERSION=${{ matrix.bundler.value }} bin/rake override_version
if: matrix.bundler.value != ''
- name: Prepare dependencies
run: |
bin/rake spec:parallel_deps
- name: Run Test
run: |
bin/parallel_rspec
Expand Down
8 changes: 6 additions & 2 deletions Rakefile
Expand Up @@ -533,12 +533,16 @@ end
namespace :spec do
desc "Ensure spec dependencies are installed"
task deps: "dev:deps" do
Spec::Rubygems.install_test_deps
chdir("bundler") do
sh("bin/setup")
end
end

desc "Ensure spec dependencies for running in parallel are installed"
task parallel_deps: "dev:deps" do
Spec::Rubygems.install_parallel_test_deps
chdir("bundler") do
sh("bin/parallel_setup")
end
end

desc "Run all specs"
Expand Down
2 changes: 1 addition & 1 deletion bin/rake
Expand Up @@ -3,7 +3,7 @@

require_relative "../bundler/spec/support/rubygems_ext"

if ["dev:deps", "dev:frozen_deps", "spec:deps", "spec:parallel_deps"].include?(ARGV[0])
if ["dev:deps", "dev:frozen_deps", "override_version", "spec:deps", "spec:parallel_deps"].include?(ARGV[0])
Spec::Rubygems.gem_load_and_possibly_install("rake", "rake")
else
Spec::Rubygems.gem_load("rake", "rake")
Expand Down
6 changes: 6 additions & 0 deletions bundler/bin/parallel_setup
@@ -0,0 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

require_relative "../spec/support/rubygems_ext"

Spec::Rubygems.install_parallel_test_deps
6 changes: 6 additions & 0 deletions bundler/bin/setup
@@ -0,0 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

require_relative "../spec/support/rubygems_ext"

Spec::Rubygems.install_test_deps
6 changes: 3 additions & 3 deletions bundler/spec/spec_helper.rb
Expand Up @@ -88,10 +88,10 @@ def self.ruby=(ruby)
ENV["THOR_COLUMNS"] = "10000"

extend(Spec::Helpers)
system_gems :bundler, path: pristine_system_gem_path
end
extend(Spec::Builders)

install_dev_bundler unless ENV["CI"]

config.before :all do
check_test_gems!

build_repo1
Expand Down
5 changes: 4 additions & 1 deletion bundler/spec/support/builders.rb
Expand Up @@ -424,17 +424,20 @@ def _build(options = {})
Dir.mkdir build_path

@context.shipped_files.each do |shipped_file|
source_shipped_file = File.expand_path(shipped_file, @context.source_root)
target_shipped_file = shipped_file
target_shipped_file = shipped_file.sub(/\Alibexec/, "exe") if @context.ruby_core?
target_shipped_file = build_path + target_shipped_file
target_shipped_dir = File.dirname(target_shipped_file)
FileUtils.mkdir_p target_shipped_dir unless File.directory?(target_shipped_dir)
FileUtils.cp shipped_file, target_shipped_file, preserve: true
FileUtils.cp source_shipped_file, target_shipped_file, preserve: true
end

@context.replace_version_file(@version, dir: build_path)
@context.replace_required_ruby_version(@required_ruby_version, dir: build_path) if @required_ruby_version

require_relative "build_metadata"

Spec::BuildMetadata.write_build_metadata(dir: build_path)

@context.gem_command "build #{@context.relative_gemspec}", dir: build_path
Expand Down
12 changes: 11 additions & 1 deletion bundler/spec/support/helpers.rb
Expand Up @@ -6,6 +6,8 @@

module Spec
module Helpers
extend self

include Spec::Path

def reset!
Expand Down Expand Up @@ -187,7 +189,7 @@ def sys_exec(cmd, options = {})

require "open3"
require "shellwords"
Open3.popen3(env, *cmd.shellsplit, chdir: dir) do |stdin, stdout, stderr, wait_thr|
Open3.popen3(env, *cmd.shellsplit, chdir: dir.to_s) do |stdin, stdout, stderr, wait_thr|
yield stdin, stdout, wait_thr if block_given?
stdin.close

Expand Down Expand Up @@ -317,6 +319,12 @@ def system_gems(*gems)
end
end

def install_dev_bundler
extend Path

system_gems :bundler, path: pristine_system_gem_path
end

def install_gem(path, install_dir, default = false)
raise "OMG `#{path}` does not exist!" unless File.exist?(path)

Expand All @@ -327,6 +335,8 @@ def install_gem(path, install_dir, default = false)
end

def with_built_bundler(version = nil, &block)
require_relative "builders"

Builders::BundlerBuilder.new(self, "bundler", version)._build(&block)
end

Expand Down
6 changes: 6 additions & 0 deletions bundler/spec/support/rubygems_ext.rb
Expand Up @@ -71,9 +71,15 @@ def setup_test_paths
end

def install_test_deps
Gem.clear_paths

install_gems(test_gemfile, Path.base_system_gems.to_s)
install_gems(rubocop_gemfile, Path.rubocop_gems.to_s)
install_gems(standard_gemfile, Path.standard_gems.to_s)

require_relative "helpers"

Helpers.install_dev_bundler
end

def check_source_control_changes(success_message:, error_message:)
Expand Down
1 change: 1 addition & 0 deletions tool/bundler/dev_gems.rb.lock
Expand Up @@ -63,6 +63,7 @@ PLATFORMS
universal-java-11
universal-java-18
universal-java-19
universal-java-20
x64-mingw-ucrt
x64-mingw32
x86_64-darwin-20
Expand Down
1 change: 1 addition & 0 deletions tool/bundler/rubocop_gems.rb.lock
Expand Up @@ -61,6 +61,7 @@ PLATFORMS
universal-java-11
universal-java-18
universal-java-19
universal-java-20
x64-mingw-ucrt
x86_64-darwin-19
x86_64-darwin-20
Expand Down
1 change: 1 addition & 0 deletions tool/bundler/standard_gems.rb.lock
Expand Up @@ -77,6 +77,7 @@ PLATFORMS
universal-java-11
universal-java-18
universal-java-19
universal-java-20
x64-mingw-ucrt
x86_64-darwin-19
x86_64-darwin-20
Expand Down
1 change: 1 addition & 0 deletions tool/bundler/test_gems.rb.lock
Expand Up @@ -31,6 +31,7 @@ PLATFORMS
universal-java-11
universal-java-18
universal-java-19
universal-java-20
x64-mingw-ucrt
x64-mingw32
x86_64-darwin-20
Expand Down