Skip to content

Commit

Permalink
Add CI to run Ruby tests suite
Browse files Browse the repository at this point in the history
  • Loading branch information
peterzhu2118 committed Jan 9, 2025
1 parent 02b9439 commit 9b23c90
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 3 deletions.
96 changes: 96 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Test
on:
push:
pull_request:

permissions:
contents: read

jobs:
check:
strategy:
fail-fast: false
matrix:
gc:
- mmtk_plan: MarkSweep
mmtk_build: release
- mmtk_plan: MarkSweep
mmtk_build: debug
timeout: 120
os: [macos-latest, ubuntu-latest]

env:
GITPULLOPTIONS: --no-tags origin ${{ github.ref }}
RUBY_DEBUG: ci

runs-on: ${{ matrix.os }}

if: >-
${{!(false
|| contains(github.event.head_commit.message, '[DOC]')
|| contains(github.event.head_commit.message, 'Document')
|| contains(github.event.pull_request.title, '[DOC]')
|| contains(github.event.pull_request.title, 'Document')
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
|| (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
)}}
steps:
- uses: actions/checkout@v4

- name: Install libraries (macOS)
if: ${{ contains(matrix.os, 'macos') }}
run: |
brew install --quiet gmp libffi openssl@3 zlib autoconf automake libtool
- name: Install libraries (Ubuntu)
if: ${{ contains(matrix.os, 'ubuntu') }}
run: |
sudo apt-get install -qq -y \
${arch:+cross}build-essential${arch/:/-} \
libssl-dev${arch} libyaml-dev${arch} libreadline6-dev${arch} \
zlib1g-dev${arch} libncurses5-dev${arch} libffi-dev${arch}
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Set MMTk environment variables
run: |
if [[ ${{ matrix.gc.mmtk_build }} == debug ]]; then
echo 'RUST_LOG=' >> $GITHUB_ENV
echo 'RUBY_TEST_TIMEOUT_SCALE=20' >> $GITHUB_ENV
echo 'SYNTAX_SUGGEST_TIMEOUT=60' >> $GITHUB_ENV
fi
echo 'EXCLUDES=./test/.excludes-mmtk' >> $GITHUB_ENV
echo 'MSPECOPT=-B./spec/mmtk.mspec' >> $GITHUB_ENV
echo 'MMTK_PLAN=${{ matrix.gc.mmtk_plan }}' >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
repository: ruby/ruby
path: ruby

- name: Build Ruby
working-directory: ruby
run: |
bash autogen.sh
./configure \
--prefix=$PWD/install \
--disable-install-doc \
--with-modular-gc=$GITHUB_WORKSPACE/ruby_gc
make -j
make install
echo "$PWD/install" >> $GITHUB_PATH
- name: MMTk shared GC
run: |
bundle install
bundle exec rake install:${{ matrix.gc.mmtk_build }}
echo "RUBY_GC_LIBRARY=mmtk" >> $GITHUB_ENV
- name: Run Ruby tests
run: >-
make -s check
timeout-minutes: ${{ matrix.gc.timeout || 40 }}
working-directory: ruby
env:
RUBY_TESTOPTS: '-q --tty=no'
TEST_BUNDLED_GEMS_ALLOW_FAILURES: 'typeprof'
PRECHECK_BUNDLED_GEMS: 'no'
4 changes: 2 additions & 2 deletions gc/mmtk/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gc/mmtk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ features = ["is_mmtk_object", "object_pinning", "sticky_immix_non_moving_nursery

# Uncomment the following lines to use mmtk-core from the official repository.
git = "https://github.com/mmtk/mmtk-core.git"
rev = "ec745353a8de72b645613e0fef3ab7f5f1ad9bd1"
rev = "68bf1b638263b250b12e55ef25bf8d09b01ca0b0"

# Uncomment the following line to use mmtk-core from a local repository.
# path = "../../../mmtk-core"
Expand Down

0 comments on commit 9b23c90

Please sign in to comment.