Skip to content

🐛 fix: rv shell integration #80

🐛 fix: rv shell integration

🐛 fix: rv shell integration #80

Workflow file for this run

name: CI
permissions:
contents: read
pull-requests: write
id-token: write
on:
push:
branches:
- 'main'
tags:
- '!*' # Do not execute on tags
pull_request:
branches:
- '*'
# Allow manually triggering the workflow.
workflow_dispatch:
# Cancels all previous workflow runs for the same branch that have not yet completed.
concurrency:
# The concurrency group contains the workflow name and the branch name.
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
jobs:
# Test the action itself across platforms and Ruby versions
test-action:
name: Action Test (${{ matrix.os }}, Ruby ${{ matrix.ruby }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest]
ruby: ['3.2', '3.3', '3.4', '4.0']
steps:
- uses: actions/checkout@v5
- name: Run setup-ruby-flash action
uses: ./
with:
ruby-version: ${{ matrix.ruby }}
cache-version: 'v3'
# Need GH Token Authenticated requests, switch once the feature is released
rv-git-ref: 'main'
# Build both ore and gemfile-go from main
ore-git-ref: 'feat/debugging'
gfgo-git-ref: 'master'
- name: Verify Ruby installation
run: |
echo "==> Ruby version:"
ruby --version
echo "==> Gem version:"
gem --version
echo "==> Ruby location:"
which ruby
echo "==> rv version:"
rv --version
# Test the action with ore gem installation (Pure Ruby)
test-action-with-ore-pure:
name: Action + Ore Test Pure Ruby Gems (${{ matrix.os }})
runs-on: ${{ matrix.os }}
env:
BUNDLE_GEMFILE: TestGemfile
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v5
- name: Create test Gemfile (Pure Ruby)
run: |
cat > ${{ env.BUNDLE_GEMFILE }} << 'EOF'
source 'https://gem.coop'
gem 'rake'
EOF
- name: Run setup-ruby-flash with ore
uses: ./
with:
ruby-version: '4.0'
ore-install: true
cache-version: 'v3'
# Need GH Token Authenticated requests, switch once the feature is released
rv-git-ref: 'main'
# Build both ore and gemfile-go from main
ore-git-ref: 'feat/debugging'
gfgo-git-ref: 'master'
- name: Verify ore installation
run: |
echo "==> ore version:"
ore --version
echo "==> Environment:"
echo "BUNDLE_GEMFILE=$BUNDLE_GEMFILE"
echo "GEM_HOME=$GEM_HOME"
echo "GEM_PATH=$GEM_PATH"
echo "Ruby: $(which ruby)"
echo "Ruby version: $(ruby --version)"
echo "==> Filesystem check:"
echo "Looking for gems in: $GEM_HOME/gems"
ls -la "$GEM_HOME/gems" || echo "Directory not found"
echo "==> Installed gems:"
ore list
echo "==> ore check (verbose):"
ore check -v
echo "==> Smoke a Rake"
bundle exec rake -T
# Test the action with ore gem installation (Compiled Extensions)
test-action-with-ore-compiled:
name: Action + Ore Test Compiled Gems (${{ matrix.os }})
runs-on: ${{ matrix.os }}
env:
BUNDLE_GEMFILE: TestGemfile
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v5
- name: Create test Gemfile (Compiled Ruby)
run: |
cat > ${{ env.BUNDLE_GEMFILE }} << 'EOF'
source 'https://gem.coop'
gem 'nokogiri'
EOF
- name: Run setup-ruby-flash with ore
uses: ./
with:
ruby-version: '4.0'
ore-install: true
cache-version: 'v3'
# Need GH Token Authenticated requests, switch once the feature is released
rv-git-ref: 'main'
# Build both ore and gemfile-go from main
ore-git-ref: 'feat/debugging'
gfgo-git-ref: 'master'
- name: Ensure ore is installed (diagnostic)
run: |
mkdir -p tmp
echo "Checking for ore binary..." > tmp/ore_presence.txt 2>&1
if [ -x "$HOME/.local/bin/ore" ]; then
echo "Found ore at $HOME/.local/bin/ore" >> tmp/ore_presence.txt 2>&1
$HOME/.local/bin/ore --version >> tmp/ore_presence.txt 2>&1 || echo "ore --version failed" >> tmp/ore_presence.txt 2>&1
elif command -v ore >/dev/null 2>&1; then
echo "Found ore in PATH: $(command -v ore)" >> tmp/ore_presence.txt 2>&1
ore --version >> tmp/ore_presence.txt 2>&1 || echo "ore --version failed" >> tmp/ore_presence.txt 2>&1
else
echo "ore binary not found in ~/.local/bin or PATH" >> tmp/ore_presence.txt 2>&1
fi
- name: "Pre-install: ore info --debug nokogiri"
run: |
mkdir -p tmp
echo "==> PRE: ore info --debug nokogiri" > tmp/pre_ore_info_nokogiri.txt 2>&1
ore info --debug nokogiri >> tmp/pre_ore_info_nokogiri.txt 2>&1 || echo "⚠️ ore info (pre) failed" >> tmp/pre_ore_info_nokogiri.txt 2>&1
- name: "Run ore install (explicit)"
run: |
echo "==> Running ore install (explicit step)" > tmp/explicit_install.txt 2>&1
ore install >> tmp/explicit_install.txt 2>&1 || true
- name: "Post-install: ore info --debug nokogiri"
run: |
echo "==> POST: ore info --debug nokogiri" > tmp/post_ore_info_nokogiri.txt 2>&1
ore info --debug nokogiri >> tmp/post_ore_info_nokogiri.txt 2>&1 || echo "⚠️ ore info (post) failed" >> tmp/post_ore_info_nokogiri.txt 2>&1
- name: Verify ore installation
run: |
mkdir -p tmp
echo "==> ore version:" > tmp/verify.txt 2>&1
ore --version >> tmp/verify.txt 2>&1 || true
echo "==> Installed gems:" >> tmp/verify.txt 2>&1
ore list >> tmp/verify.txt 2>&1 || true
echo "==> Debug: Check gem directory structure:" >> tmp/verify.txt 2>&1
echo "GEM_HOME=$GEM_HOME" >> tmp/verify.txt 2>&1
if [ -d "$GEM_HOME/gems" ]; then
echo "Contents of $GEM_HOME/gems:" >> tmp/verify.txt 2>&1
ls -la "$GEM_HOME/gems" | head -20 >> tmp/verify.txt 2>&1
else
echo "⚠️ $GEM_HOME/gems does not exist!" >> tmp/verify.txt 2>&1
fi
echo "==> Debug: Check BUNDLE_GEMFILE and lockfile:" >> tmp/verify.txt 2>&1
echo "BUNDLE_GEMFILE=$BUNDLE_GEMFILE" >> tmp/verify.txt 2>&1
if [ -f "${BUNDLE_GEMFILE}.lock" ]; then
echo "Lockfile ${BUNDLE_GEMFILE}.lock exists" >> tmp/verify.txt 2>&1
echo "First 20 lines of lockfile:" >> tmp/verify.txt 2>&1
head -20 "${BUNDLE_GEMFILE}.lock" >> tmp/verify.txt 2>&1
else
echo "⚠️ Lockfile ${BUNDLE_GEMFILE}.lock not found!" >> tmp/verify.txt 2>&1
fi
echo "==> ore check (verbose):" >> tmp/ore_check_verbose.txt 2>&1
ore check -v >> tmp/ore_check_verbose.txt 2>&1 || true
- name: Upload debug artifacts
uses: actions/upload-artifact@v4
with:
name: ore-debug-output-${{ github.job }}-${{ matrix.os }}-${{ github.run_id }}
path: |
tmp/pre_ore_info_nokogiri.txt
tmp/explicit_install.txt
tmp/post_ore_info_nokogiri.txt
tmp/verify.txt
tmp/ore_check_verbose.txt
# Test the action with ore gem installation (Fetch)
test-fetch-with-ore:
name: Action + Ore Test Fetch Gems (${{ matrix.os }})
runs-on: ${{ matrix.os }}
env:
BUNDLE_GEMFILE: TestGemfile
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v5
- name: Create test Gemfile (Fetch Ruby)
run: |
cat > ${{ env.BUNDLE_GEMFILE }} << 'EOF'
source 'https://gem.coop'
gem 'nokogiri'
EOF
- name: Run setup-ruby-flash with ore
uses: ./
with:
ruby-version: '4.0'
ore-install: true
cache-version: 'v3'
# Need GH Token Authenticated requests, switch once the feature is released
rv-git-ref: 'main'
# Build both ore and gemfile-go from main
ore-git-ref: 'feat/debugging'
gfgo-git-ref: 'master'
- name: Ensure ore is installed (diagnostic)
run: |
mkdir -p tmp
echo "Checking for ore binary..." > tmp/ore_presence.txt 2>&1
if [ -x "$HOME/.local/bin/ore" ]; then
echo "Found ore at $HOME/.local/bin/ore" >> tmp/ore_presence.txt 2>&1
$HOME/.local/bin/ore --version >> tmp/ore_presence.txt 2>&1 || echo "ore --version failed" >> tmp/ore_presence.txt 2>&1
elif command -v ore >/dev/null 2>&1; then
echo "Found ore in PATH: $(command -v ore)" >> tmp/ore_presence.txt 2>&1
ore --version >> tmp/ore_presence.txt 2>&1 || echo "ore --version failed" >> tmp/ore_presence.txt 2>&1
else
echo "ore binary not found in ~/.local/bin or PATH" >> tmp/ore_presence.txt 2>&1
fi
- name: "Pre-install: ore info --debug nokogiri"
run: |
mkdir -p tmp
echo "==> PRE: ore info --debug nokogiri" > tmp/pre_ore_info_nokogiri.txt 2>&1
ore info --debug nokogiri >> tmp/pre_ore_info_nokogiri.txt 2>&1 || echo "⚠️ ore info (pre) failed" >> tmp/pre_ore_info_nokogiri.txt 2>&1
- name: "Run ore install (fetch)"
run: |
echo "==> Running ore install (fetch step)" > tmp/fetch_install.txt 2>&1
ore install --fetch >> tmp/fetch_install.txt 2>&1 || true
- name: "Post-install: ore info --debug nokogiri"
run: |
echo "==> POST: ore info --debug nokogiri" > tmp/post_ore_info_nokogiri.txt 2>&1
ore info --debug nokogiri >> tmp/post_ore_info_nokogiri.txt 2>&1 || echo "⚠️ ore info (post) failed" >> tmp/post_ore_info_nokogiri.txt 2>&1
- name: Verify ore installation
run: |
mkdir -p tmp
echo "==> ore version:" > tmp/verify.txt 2>&1
ore --version >> tmp/verify.txt 2>&1 || true
echo "==> Installed gems:" >> tmp/verify.txt 2>&1
ore list >> tmp/verify.txt 2>&1 || true
echo "==> Debug: Check gem directory structure:" >> tmp/verify.txt 2>&1
echo "GEM_HOME=$GEM_HOME" >> tmp/verify.txt 2>&1
if [ -d "$GEM_HOME/gems" ]; then
echo "Contents of $GEM_HOME/gems:" >> tmp/verify.txt 2>&1
ls -la "$GEM_HOME/gems" | head -20 >> tmp/verify.txt 2>&1
else
echo "⚠️ $GEM_HOME/gems does not exist!" >> tmp/verify.txt 2>&1
fi
echo "==> Debug: Check BUNDLE_GEMFILE and lockfile:" >> tmp/verify.txt 2>&1
echo "BUNDLE_GEMFILE=$BUNDLE_GEMFILE" >> tmp/verify.txt 2>&1
if [ -f "${BUNDLE_GEMFILE}.lock" ]; then
echo "Lockfile ${BUNDLE_GEMFILE}.lock exists" >> tmp/verify.txt 2>&1
echo "First 20 lines of lockfile:" >> tmp/verify.txt 2>&1
head -20 "${BUNDLE_GEMFILE}.lock" >> tmp/verify.txt 2>&1
else
echo "⚠️ Lockfile ${BUNDLE_GEMFILE}.lock not found!" >> tmp/verify.txt 2>&1
fi
echo "==> ore check (verbose):" >> tmp/ore_check_verbose.txt 2>&1
ore check -v >> tmp/ore_check_verbose.txt 2>&1 || true
- name: Upload debug artifacts
uses: actions/upload-artifact@v4
with:
name: ore-debug-output-${{ github.job }}-${{ matrix.os }}-${{ github.run_id }}
path: |
tmp/pre_ore_info_nokogiri.txt
tmp/fetch_install.txt
tmp/post_ore_info_nokogiri.txt
tmp/verify.txt
tmp/ore_check_verbose.txt
- name: Run ore fetch nokogiri (diagnostic)
run: |
mkdir -p tmp
echo "==> ore fetch nokogiri" > tmp/fetch_nokogiri.txt 2>&1
if [ -x "$HOME/.local/bin/ore" ]; then
$HOME/.local/bin/ore fetch nokogiri >> tmp/fetch_nokogiri.txt 2>&1 || echo "⚠️ ore fetch failed" >> tmp/fetch_nokogiri.txt 2>&1
elif command -v ore >/dev/null 2>&1; then
ore fetch nokogiri >> tmp/fetch_nokogiri.txt 2>&1 || echo "⚠️ ore fetch failed" >> tmp/fetch_nokogiri.txt 2>&1
else
echo "ore binary not found; cannot fetch" >> tmp/fetch_nokogiri.txt 2>&1
fi
- name: Upload fetch debug artifact
uses: actions/upload-artifact@v4
with:
name: ore-fetch-debug-${{ github.job }}-${{ matrix.os }}-${{ github.run_id }}
path: |
tmp/fetch_nokogiri.txt
# Run acceptance tests (after action installs Ruby)
acceptance-tests:
name: Acceptance Tests (Ruby ${{ matrix.ruby }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: ['3.2', '3.3', '3.4', '4.0']
steps:
- uses: actions/checkout@v5
- name: Run setup-ruby-flash action
uses: ./
with:
ruby-version: ${{ matrix.ruby }}
ore-install: true
cache-version: 'v3'
# Need GH Token Authenticated requests, switch once the feature is released
rv-git-ref: 'main'
# Build both ore and gemfile-go from main
ore-git-ref: 'feat/debugging'
gfgo-git-ref: 'master'
- name: Run acceptance tests
env:
EXPECTED_RUBY_VERSION: ${{ matrix.ruby }}
run: bundle exec rspec spec/acceptance/
# Lint the Ruby code (acceptance tests, Rakefile, etc.)
lint:
name: RuboCop
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Run setup-ruby-flash action
uses: ./
with:
ruby-version: '4.0'
ore-install: true
cache-version: 'v3'
# Need GH Token Authenticated requests, switch once the feature is released
rv-git-ref: 'main'
# Build both ore and gemfile-go from main
ore-git-ref: 'feat/debugging'
gfgo-git-ref: 'master'
- name: Run RuboCop
run: bundle exec rubocop
# Test gfgo-git-ref feature (build ore with gemfile-go from source)
test-gfgo-git-ref:
name: Test gfgo-git-ref (${{ matrix.os }})
runs-on: ${{ matrix.os }}
env:
BUNDLE_GEMFILE: TestGemfile
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v5
- name: Create test Gemfile
run: |
cat > ${{ env.BUNDLE_GEMFILE }} << 'EOF'
source 'https://gem.coop'
gem 'rake'
EOF
- name: Run setup-ruby-flash with ore and gemfile-go from source
uses: ./
with:
ruby-version: '4.0'
ore-install: true
cache-version: 'v3'
# Need GH Token Authenticated requests, switch once the feature is released
rv-git-ref: 'main'
# Build both ore and gemfile-go from main
ore-git-ref: 'feat/debugging'
gfgo-git-ref: 'master'
- name: Verify ore installation
run: |
echo "==> ore version:"
ore --version
echo "==> Installed gems:"
ore list
echo "==> ore check:"
ore check
# Test automatic fallback to ruby/setup-ruby
test-fallback:
name: Test Fallback (${{ matrix.ruby }})
runs-on: ubuntu-latest
env:
BUNDLE_GEMFILE: TestGemfile
strategy:
fail-fast: false
matrix:
ruby: ['3.1', 'jruby-9.4', '4.0', 'head']
steps:
- uses: actions/checkout@v5
- name: Create test Gemfile
run: |
cat > ${{ env.BUNDLE_GEMFILE }} << 'EOF'
source 'https://gem.coop'
gem 'rake'
EOF
- name: Setup Ruby (demonstrates override options)
uses: ./
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
# Force '4.0' to use ruby/setup-ruby for benchmarking
use-setup-ruby: ${{ matrix.ruby == '4.0' && matrix.ruby || '' }}
# Force 'head' to attempt setup-ruby-flash (will fail until rv supports it)
# use-setup-ruby-flash: ${{ matrix.ruby == 'head' && matrix.ruby || '' }}
- name: Verify Ruby installation
run: |
echo "==> Ruby version:"
ruby --version
echo "==> Gem version:"
gem --version
echo "==> Bundler version:"
bundle --version
echo "==> Smoke a Rake"
bundle exec rake -T