Skip to content

Merge pull request #7662 from nobu/fix-with_env #9063

Merge pull request #7662 from nobu/fix-with_env

Merge pull request #7662 from nobu/fix-with_env #9063

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.7 }
- { name: "3.1", value: 3.1.5 }
- { name: "3.2", value: 3.2.4 }
- { name: "3.3", value: 3.3.1 }
- { name: jruby, value: jruby-9.4.7.0 }
- { name: truffleruby, value: truffleruby-24.0.1 }
openssl:
- { name: "openssl", value: true }
- { name: "no-openssl", value: false }
steps:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
- name: Setup ruby
uses: ruby/setup-ruby@cacc9f1c0b3f4eb8a16a6bb0ed10897b43b9de49 # v1.176.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: Workaround bad nio4r release on JRuby, so that Rails can be installed below
run: gem install nio4r --version 2.7.1
if: matrix.ruby.name == 'jruby'
- 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.5 } # Rails 7
- { name: "3.2", value: 3.2.4 } # Rails 7
- { name: "3.3", value: 3.3.1 } # Rails 7
- { name: jruby-9.4, value: jruby-9.4.7.0, rails-args: "--skip-webpack-install" } # Rails 6
steps:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
- name: Setup ruby
uses: ruby/setup-ruby@cacc9f1c0b3f4eb8a16a6bb0ed10897b43b9de49 # v1.176.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