Skip to content

ruby-latest

ruby-latest #106

Workflow file for this run

name: ruby-latest
on:
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:
inputs:
ruby_commit:
description: 'Ruby commit to test'
required: true
default: 'master'
bisect_good:
description: 'Healthy Ruby commit to end bisecting at'
required: false
bisect_bad:
description: 'Broken Ruby commit to start bisecting from'
required: false
permissions:
contents: read
jobs:
ruby-latest:
name: Test rbspy with upstream Ruby's main branch
runs-on: ubuntu-22.04
timeout-minutes: 60
env:
MAKEFLAGS: -j4
RUBY_LATEST_STABLE_VERSION: 3.3.0
RUST_BACKTRACE: 1
steps:
- name: Install Rust
uses: dtolnay/rust-toolchain@984d158d699777abbaa79de23de3134e60c187fa # stable branch
- name: Check out latest Ruby source
uses: actions/checkout@v4
with:
path: ruby
repository: ruby/ruby
ref: ${{ inputs.ruby_commit }}
fetch-depth: 0
- name: Check out rbspy source
uses: actions/checkout@v4
with:
path: rbspy
- name: Cargo Cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo0-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo0-
- name: Build rbspy
run: |
cd rbspy
cargo build --release
- name: Install dependencies
run: |
# Workaround for missing digest gem. https://github.com/ruby/psych/issues/552
sudo apt-get update && sudo apt-get install -qq libyaml-dev libffi-dev moreutils
- name: Build Ruby and run rbspy tests
run: |
cat <<EOF > build-and-test-ruby-version.sh
#!/bin/bash
set -euxo pipefail
sudo rm -rf ~/.bundle
chronic sudo git clean -fdx
chronic ./autogen.sh
chronic ./configure --disable-install-doc
chronic make || exit 125
chronic sudo make install || exit 125
echo "Ruby version: \$(/usr/local/bin/ruby -v)"
cd $GITHUB_WORKSPACE/rbspy
/usr/local/bin/ruby ci/ruby-programs/infinite.rb &
sudo ./target/release/rbspy record --pid \$! --duration 2 --force-version $RUBY_LATEST_STABLE_VERSION --silent
EOF
chmod u+x build-and-test-ruby-version.sh
cd ruby
if [ -n "${{ inputs.bisect_bad }}" ]; then
git bisect start
git bisect bad ${{ inputs.bisect_bad }}
git bisect good ${{ inputs.bisect_good }}
git bisect run ../build-and-test-ruby-version.sh
git bisect reset
else
../build-and-test-ruby-version.sh
fi