Skip to content

Commit f37fe8b

Browse files
Add MMTk builds to CI
1 parent c56b7f0 commit f37fe8b

File tree

3 files changed

+201
-0
lines changed

3 files changed

+201
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Setup macOS environment
2+
description: >-
3+
Installs necessary packages via Homebrew.
4+
5+
inputs: {} # nothing?
6+
7+
outputs: {} # nothing?
8+
9+
runs:
10+
using: composite
11+
12+
steps:
13+
- name: brew
14+
shell: bash
15+
run: |
16+
brew install --quiet gmp libffi openssl@3 zlib autoconf automake libtool
17+
18+
- name: Set ENV
19+
shell: bash
20+
run: |
21+
dir_config() {
22+
local args=() lib var="$1"; shift
23+
for lib in "$@"; do
24+
args+="--with-${lib%@*}-dir=$(brew --prefix $lib)"
25+
done
26+
echo "$var=${args[*]}" >> $GITHUB_ENV
27+
}
28+
dir_config ruby_configure_args gmp
29+
dir_config CONFIGURE_ARGS openssl@3
30+
31+
- name: make sure that kern.coredump=1
32+
shell: bash
33+
run: |
34+
sysctl -n kern.coredump
35+
sudo sysctl -w kern.coredump=1
36+
sudo chmod -R +rwx /cores/
37+
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Setup ubuntu environment
2+
description: >-
3+
At the beginning there was no way but to copy & paste `apt-get`
4+
everywhere. But now that we have composite actions, it seems better
5+
merge them into one.
6+
7+
inputs:
8+
arch:
9+
required: false
10+
default: ''
11+
description: >-
12+
Architecture. Because we run this on a GitHub-hosted runner
13+
acceptable value for this input is very limited.
14+
15+
outputs:
16+
arch:
17+
value: ${{ steps.uname.outputs.uname }}
18+
description: >-
19+
Actual architecture. This could be different from the one
20+
passed to the `inputs.arch`. For instance giving `i386` to this
21+
action yields `i686`.
22+
23+
runs:
24+
using: composite
25+
26+
steps:
27+
- name: set SETARCH
28+
shell: bash
29+
run: echo "SETARCH=${setarch}" >> "$GITHUB_ENV"
30+
env:
31+
setarch: ${{ inputs.arch && format('setarch {0} --', inputs.arch) }}
32+
33+
- id: uname
34+
name: uname
35+
shell: bash
36+
run: |
37+
echo uname=`${SETARCH} uname -m` >> "$GITHUB_OUTPUT"
38+
echo dpkg=`${SETARCH} uname -m | sed s/686/386/` >> "$GITHUB_OUTPUT"
39+
40+
- name: apt-get
41+
shell: bash
42+
env:
43+
arch: ${{ inputs.arch && format(':{0}', steps.uname.outputs.dpkg) || '' }}
44+
run: |
45+
set -x
46+
${arch:+sudo dpkg --add-architecture ${arch#:}}
47+
sudo apt-get update -qq || :
48+
sudo apt-get install --no-install-recommends -qq -y -o=Dpkg::Use-Pty=0 \
49+
${arch:+cross}build-essential${arch/:/-} \
50+
libssl-dev${arch} libyaml-dev${arch} libreadline6-dev${arch} \
51+
zlib1g-dev${arch} libncurses5-dev${arch} libffi-dev${arch} \
52+
autoconf ruby
53+
sudo apt-get install -qq -y pkg-config${arch} || :
54+
55+
- uses: ruby/setup-ruby@a6e6f86333f0a2523ece813039b8b4be04560854 # v1.190.0
56+
with:
57+
ruby-version: '3.3'
58+
bundler: none

.github/workflows/tests.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: MMTk
2+
on:
3+
push:
4+
paths-ignore:
5+
- '**.md'
6+
pull_request:
7+
# Do not use paths-ignore for required status checks
8+
# https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks
9+
merge_group:
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
check:
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
gc:
20+
- mmtk_plan: MarkSweep
21+
mmtk_build: release
22+
timeout: 120
23+
- mmtk_plan: MarkSweep
24+
mmtk_build: debug
25+
timeout: 120
26+
os: [macos-latest, ubuntu-latest]
27+
28+
env:
29+
GITPULLOPTIONS: --no-tags origin ${{ github.ref }}
30+
RUBY_DEBUG: ci
31+
32+
runs-on: ${{ matrix.os }}
33+
34+
if: >-
35+
${{!(false
36+
|| contains(github.event.head_commit.message, '[DOC]')
37+
|| contains(github.event.head_commit.message, 'Document')
38+
|| contains(github.event.pull_request.title, '[DOC]')
39+
|| contains(github.event.pull_request.title, 'Document')
40+
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
41+
|| (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
42+
)}}
43+
44+
steps:
45+
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
46+
47+
- name: Install libraries (macOS)
48+
uses: ./.github/actions/setup/macos
49+
if: ${{ contains(matrix.os, 'macos') }}
50+
51+
- name: Install libraries (Ubuntu)
52+
uses: ./.github/actions/setup/ubuntu
53+
if: ${{ contains(matrix.os, 'ubuntu') }}
54+
55+
- uses: actions-rust-lang/setup-rust-toolchain@v1
56+
- name: Set MMTk environment variables
57+
run: |
58+
if [[ ${{ matrix.gc.mmtk_build }} == debug ]]; then
59+
echo 'RUST_LOG=' >> $GITHUB_ENV
60+
fi
61+
echo 'RUBY_TEST_TIMEOUT_SCALE=20' >> $GITHUB_ENV
62+
echo 'SYNTAX_SUGGEST_TIMEOUT=60' >> $GITHUB_ENV
63+
echo 'EXCLUDES=./test/.excludes-mmtk' >> $GITHUB_ENV
64+
echo 'MSPECOPT=-B./spec/mmtk.mspec' >> $GITHUB_ENV
65+
echo 'MMTK_PLAN=${{ matrix.gc.mmtk_plan }}' >> $GITHUB_ENV
66+
echo 'GITHUB_WORKFLOW=MMTk' >> $GITHUB_ENV
67+
68+
- name: Install Bundler dependencies
69+
run: bundle install
70+
71+
- uses: actions/checkout@v4
72+
with:
73+
repository: ruby/ruby
74+
path: ruby
75+
76+
- name: configure ruby
77+
working-directory: ruby
78+
run: |
79+
bash autogen.sh
80+
./configure \
81+
--prefix=/opt/homebrew \
82+
--disable-install-doc \
83+
--with-modular-gc=${{ github.workspace }}/tmp/binaries
84+
make -j
85+
make install
86+
echo '/opt/homebrew/bin' >> $GITHUB_PATH
87+
88+
- name: build Ruby & MMTk shared GC
89+
run: |
90+
bundle install
91+
bundle exec rake compile
92+
93+
- name: make test-all
94+
run: >-
95+
RUST_LOG= make -s test-all
96+
${TESTS:+TESTS="$TESTS"}
97+
timeout-minutes: ${{ matrix.gc.timeout || 40 }}
98+
working-directory: ruby
99+
env:
100+
RUBY_TESTOPTS: '-q --tty=no'
101+
TEST_BUNDLED_GEMS_ALLOW_FAILURES: 'typeprof'
102+
PRECHECK_BUNDLED_GEMS: 'no'
103+
RUBY_GC_LIBRARY: mmtk
104+
105+
106+

0 commit comments

Comments
 (0)