Skip to content

Commit

Permalink
WIP Merge shared GC CI
Browse files Browse the repository at this point in the history
  • Loading branch information
eightbitraptor committed Oct 15, 2024
1 parent c35d5c5 commit d99c860
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 60 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Shared GC (Ubuntu)
name: MMTK
on:
push:
paths-ignore:
Expand All @@ -24,6 +24,7 @@ jobs:
make:
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
gc_name: ['default', 'mmtk']
build: ['debug', 'release']
mmtk_plan: ['MarkSweep', 'Immix']
Expand All @@ -36,14 +37,14 @@ jobs:
- gc_name: 'default'
build: 'release'
- gc_name: 'default'
mmtk_plan: ['Immix']
mmtk_plan: 'Immix'
fail-fast: false

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

runs-on: ${{ matrix.os || 'ubuntu-22.04' }}
runs-on: ${{ matrix.os }}

if: >-
${{!(false
Expand All @@ -61,14 +62,19 @@ jobs:
sparse-checkout-cone-mode: false
sparse-checkout: /.github

- uses: ./.github/actions/setup/ubuntu
with:
arch: ${{ matrix.arch }}
- name: Install libraries (macOS)
uses: ./.github/actions/setup/macos
if: ${{ contains(matrix.os, 'macos') }}

- name: Install libraries (Ubuntu)
uses: ./.github/actions/setup/ubuntu
if: ${{ contains(matrix.os, 'ubuntu') }}

- uses: ruby/setup-ruby@a6e6f86333f0a2523ece813039b8b4be04560854 # v1.190.0
with:
ruby-version: '3.0'
bundler: none
if: ${{ contains(matrix.os, 'ubuntu') }}

- uses: ./.github/actions/setup/directories
with:
Expand All @@ -80,17 +86,29 @@ jobs:
# Set fetch-depth: 10 so that Launchable can receive commits information.
fetch-depth: 10

- name: make sure that kern.coredump=1
run: |
sysctl -n kern.coredump
sudo sysctl -w kern.coredump=1
sudo chmod -R +rwx /cores/
if: ${{ contains(matrix.os, 'macos') }}

- name: Delete unused SDKs
# To free up disk space to not run out during the run
run: |
sudo rm -rf ~/.dotnet
sudo rm -rf /Library/Android
sudo rm -rf /Library/Developer/CoreSimulator
continue-on-error: true
if: ${{ contains(matrix.os, 'macos') }}

- name: Run configure
env:
arch: ${{ matrix.arch }}
configure: ${{ matrix.configure }}
run: >-
$SETARCH ../src/configure -C --disable-install-doc ${configure:-cppflags=-DRUBY_DEBUG}
${arch:+--target=$arch-$OSTYPE --host=$arch-$OSTYPE}
- run: $SETARCH make prepare-gems
if: ${{ matrix.test_task == 'test-bundled-gems' }}

- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Build MMTK Ruby lib
run: |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Shared GC (macOS)
name: Shared GC (Ubuntu)
on:
push:
paths-ignore:
Expand All @@ -24,21 +24,25 @@ jobs:
make:
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
gc_name: ['default', 'mmtk']
build: ['debug', 'release']
mmtk_plan: ['MarkSweep', 'Immix']
include:
- configure: '--with-shared-gc=/home/runner/ruby_gc'
- test_task: check
gc_name: 'mmtk'
build: 'debug'
configure: '--with-shared-gc=/Users/runner/ruby_gc'
os: macos-14
- test_task: check
gc_name: 'mmtk'
# This matrix configuration will generate multiple 'default' GC jobs, but we only care about one
# So exclude all default "release" builds and all other plans except one.
exclude:
- gc_name: 'default'
build: 'release'
configure: '--with-shared-gc=/Users/runner/ruby_gc'
os: macos-14
- gc_name: 'default'
mmtk_plan: ['Immix']
fail-fast: false

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

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

Expand All @@ -58,8 +62,19 @@ jobs:
sparse-checkout-cone-mode: false
sparse-checkout: /.github

- name: Install libraries
- name: Install libraries (macOS)
uses: ./.github/actions/setup/macos
if: ${{ contains(matrix.os, 'macos') }}

- name: Install libraries (Ubuntu)
uses: ./.github/actions/setup/ubuntu
if: ${{ contains(matrix.os, 'ubuntu') }}

- uses: ruby/setup-ruby@a6e6f86333f0a2523ece813039b8b4be04560854 # v1.190.0
with:
ruby-version: '3.0'
bundler: none
if: ${{ contains(matrix.os, 'ubuntu') }}

- uses: ./.github/actions/setup/directories
with:
Expand All @@ -68,14 +83,15 @@ jobs:
makeup: true
clean: true
dummy-files: ${{ matrix.test_task == 'check' }}
# Set fetch-depth: 0 so that Launchable can receive commits information.
# Set fetch-depth: 10 so that Launchable can receive commits information.
fetch-depth: 10

- name: make sure that kern.coredump=1
run: |
sysctl -n kern.coredump
sudo sysctl -w kern.coredump=1
sudo chmod -R +rwx /cores/
if: ${{ contains(matrix.os, 'macos') }}

- name: Delete unused SDKs
# To free up disk space to not run out during the run
Expand All @@ -84,11 +100,17 @@ jobs:
sudo rm -rf /Library/Android
sudo rm -rf /Library/Developer/CoreSimulator
continue-on-error: true
if: ${{ contains(matrix.os, 'macos') }}

- name: Run configure
env:
configure: ${{ matrix.configure }} ${ruby_configure_args}
run: ../src/configure -C --disable-install-doc ${{ env.configure }}
run: >-
$SETARCH ../src/configure -C --disable-install-doc ${configure:-cppflags=-DRUBY_DEBUG}
${arch:+--target=$arch-$OSTYPE --host=$arch-$OSTYPE}
- run: $SETARCH make prepare-gems
if: ${{ matrix.test_task == 'test-bundled-gems' }}

- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Build MMTK Ruby lib
Expand All @@ -115,16 +137,13 @@ jobs:
fi
if: ${{ matrix.gc_name == 'mmtk' }}

- run: make prepare-gems
if: ${{ matrix.test_task == 'test-bundled-gems' }}

- run: make
- run: $SETARCH make

- run: |
make golf
$SETARCH make golf
case "${{ matrix.configure }}" in
*'--enable-shared'*)
make runnable
$SETARCH make runnable
./bin/goruby -veh
;;
*)
Expand All @@ -142,65 +161,44 @@ jobs:
- name: Set up Launchable
uses: ./.github/actions/launchable/setup
with:
os: ${{ matrix.os }}
test-opts: ${{ matrix.test_opts }}
os: ${{ matrix.os || 'ubuntu-22.04' }}
test-opts: ${{ matrix.configure }}
launchable-token: ${{ secrets.LAUNCHABLE_TOKEN }}
builddir: build
srcdir: src
continue-on-error: true

- name: Set extra test options
run: |
echo "TESTS=$TESTS ${{ matrix.test_opts }}" >> $GITHUB_ENV
echo "RUBY_TEST_TIMEOUT_SCALE=10" >> $GITHUB_ENV # With --repeat-count=2, flaky test by timeout occurs frequently for some reason
if: matrix.test_opts

- name: make ${{ matrix.test_task }}
run: |
ulimit -c unlimited
make -s ${{ matrix.test_task }} ${TESTS:+TESTS="$TESTS"}
timeout-minutes: 60
run: >-
$SETARCH make -s ${{ matrix.test_task }}
${TESTS:+TESTS="$TESTS"}
${{ !contains(matrix.test_task, 'bundle') && 'RUBYOPT=-w' || '' }}
timeout-minutes: ${{ matrix.timeout || 40 }}
env:
RUBY_TESTOPTS: '-q --tty=no'
TEST_BUNDLED_GEMS_ALLOW_FAILURES: 'typeprof'
PRECHECK_BUNDLED_GEMS: 'no'
MMTK_PLAN: ${{ matrix.mmtk_plan }}

- name: make skipped tests
run: |
make -s test-all TESTS="${TESTS//-n!\//-n/}"
$SETARCH make -s test-all TESTS="${TESTS//-n!\//-n/}"
env:
GNUMAKEFLAGS: ''
RUBY_TESTOPTS: '-v --tty=no'
PRECHECK_BUNDLED_GEMS: 'no'
if: ${{ matrix.test_task == 'check' && matrix.skipped_tests }}
continue-on-error: ${{ matrix.continue-on-skipped_tests || false }}

- uses: ./.github/actions/slack
with:
label: ${{ matrix.os }} / ${{ matrix.test_task }}
label: ${{ matrix.test_task }} ${{ matrix.configure }}${{ matrix.arch }}
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
if: ${{ failure() }}

- name: Resolve job ID
id: job_id
uses: actions/github-script@main
env:
matrix: ${{ toJson(matrix) }}
with:
script: |
const { data: workflow_run } = await github.rest.actions.listJobsForWorkflowRun({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.runId
});
const matrix = JSON.parse(process.env.matrix);
const job_name = `${context.job}${matrix ? ` (${Object.values(matrix).join(", ")})` : ""}`;
return workflow_run.jobs.find((job) => job.name === job_name).id;
result:
if: ${{ always() }}
name: ${{ github.workflow }} result
runs-on: macos-latest
runs-on: ubuntu-latest
needs: [make]
steps:
- run: exit 1
Expand Down

0 comments on commit d99c860

Please sign in to comment.