Skip to content

Add bundler before/after eval hooks for plugins #8770

Add bundler before/after eval hooks for plugins

Add bundler before/after eval hooks for plugins #8770

name: install-rubygems
on:
pull_request:
push:
branches:
- master
concurrency:
group: ci-${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
permissions: # added using https://github.com/step-security/secure-workflows
contents: read
jobs:
install_rubygems_ubuntu:
name: Install Rubygems on Ubuntu (${{ matrix.ruby.name }}, ${{ matrix.openssl.name }})
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
ruby:
- { name: "3.0", value: 3.0.6 }
- { 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: truffleruby-23, value: truffleruby-23.1.2 }
openssl:
- { name: "openssl", value: true }
- { name: "no-openssl", value: false }
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- name: Setup ruby
uses: ruby/setup-ruby@5f19ec79cedfadb78ab837f95b87734d0003c899 # v1.173.0
with:
ruby-version: ${{ matrix.ruby.value }}
bundler: none
- name: Check successful install without warnings
run: |
ruby -Ilib -S rake install 2> errors.txt || (cat errors.txt && exit 1)
test ! -s errors.txt || (cat errors.txt && exit 1)
- name: Check downgrading
run: gem update --system 3.3.3
- name: Check installing fileutils
run: gem install fileutils
- name: Check installing with upgraded fileutils
run: |
ruby -Ilib -S rake install 2> errors.txt || (cat errors.txt && exit 1)
test ! -s errors.txt || (cat errors.txt && exit 1)
- name: Run a local rubygems command
run: gem list bundler
env:
RUBYOPT: -Itest/rubygems/fake_certlib
if: matrix.openssl.value == false
- name: Run a local rubygems command
run: gem list bundler
if: matrix.openssl.value == true
- name: Run a remote rubygems command
run: gem outdated
if: matrix.openssl.value == true
- name: Check commands in presence of a plugin that leaves unresolved dependencies print no warnings
run: |
gem install attempt:0.6.2 rspec:3.10.0 rspec:3.11.0
mkdir -p tmp/plugin-home
echo "require 'attempt'" > tmp/plugin-home/rubygems_plugin.rb
RUBYOPT=-Itmp/plugin-home gem env version 2> errors.txt || (cat errors.txt && exit 1)
test ! -s errors.txt || (cat errors.txt && exit 1)
RUBYOPT=-Itmp/plugin-home gem install sys-admin:1.8.1 2> errors.txt || (cat errors.txt && exit 1)
test ! -s errors.txt || (cat errors.txt && exit 1)
- name: Run bundler installed as a default gem
run: bundle --version
- name: Check bundler man pages were installed and are properly picked up
run: bundle install --help | grep -q BUNDLE-INSTALL
- name: Check bundler fallback man pages are properly picked up
run: sudo rm $(which man) && bundle install --help
- name: Build bundler
run: gem build bundler.gemspec
working-directory: ./bundler
- name: Install built bundler
run: gem install bundler-*.gem --verbose --backtrace > output.txt
working-directory: ./bundler
- name: Check bundler install didn't hit the network
run: if grep -q 'GET http' output.txt; then false; else true; fi
working-directory: ./bundler
- name: Check rails can be installed
run: gem install rails --verbose --backtrace
timeout-minutes: 10
install_rubygems_windows:
name: Install Rubygems on Windows (${{ matrix.ruby.name }})
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
ruby:
- { 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
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- name: Setup ruby
uses: ruby/setup-ruby@5f19ec79cedfadb78ab837f95b87734d0003c899 # v1.173.0
with:
ruby-version: ${{ matrix.ruby.value }}
bundler: none
- name: Setup java
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
distribution: temurin
java-version: 19.0.2
if: startsWith(matrix.ruby.name, 'jruby')
- name: Install rubygems
run: ruby setup.rb
shell: bash
- name: Check installation didn't modify any source controlled files
run: git add . && git diff --cached --exit-code
shell: bash
- name: Check we can install a Gemfile with git sources
run: bundle init && bundle add fileutils --git https://github.com/ruby/fileutils
shell: bash
- name: Generate a Rails application
run: gem install rails --version 7.0.8 && rails new foo ${{ matrix.ruby.rails-args }}
shell: bash
timeout-minutes: 20