Skip to content

Commit

Permalink
try a reusable workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
eightbitraptor committed Nov 27, 2024
1 parent 7caa167 commit 7718266
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 66 deletions.
60 changes: 0 additions & 60 deletions .github/actions/setup/mmtkbuilder/action.yml

This file was deleted.

62 changes: 62 additions & 0 deletions .github/workflows/mmtk-builder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: MMTk Builder
description: >-
Installs and configures OS Ruby build deps and Rust for MMTk
on:
workflow_call:
inputs:
os:
desciption: Short string representing OS (ubuntu|macos)
required: true
default: ubuntu

mmtk_plan:
description: the MMTk plan name to store in the environment
require: true
default: MarkSweep

mmtk_build:
description: The MMTk build (debug|release)
require: true
default: release

jobs:
build:
steps:
- name: Install libraries (macOS)
shell: bash
uses: ./.github/actions/setup/macos
if: ${{ contains(inputs.os, 'macos') }}

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

- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Set MMTk environment variables
shell: bash
run: |
if [[ ${{ inputs.mmtk_build }} == debug ]]; then
echo 'RUST_LOG=' >> $GITHUB_ENV
# Debug builds run much slower so we should increase the timeout
echo 'RUBY_TEST_TIMEOUT_SCALE=10' >> $GITHUB_ENV
# SYNTAX_SUGGEST_TIMEOUT defaults to 1 second
echo 'SYNTAX_SUGGEST_TIMEOUT=60' >> $GITHUB_ENV
fi
echo 'MMTK_PLAN=${{ inputs.mmtk_plan }}' >> $GITHUB_ENV
- uses: ruby/setup-ruby@a6e6f86333f0a2523ece813039b8b4be04560854 # v1.190.0
shell: bash
with:
ruby-version: '3.3'
if: ${{ contains(inputs.os, 'ubuntu') }}

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

14 changes: 8 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,16 @@ jobs:

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

build:
uses: ./.github/workflows/mmtk-builder.yml
with:
os: ${{ matrix.os }}
mmtk_plan: ${{ matrix.gc.mmtk_plan }}
mmtk_build: ${{ matrix.gc.mmtk_build }}


steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- uses: ./.github/actions/setup/mmtkbuilder
with:
os: ${{ matrix.os }}
mmtk_plan: ${{ matrix.gc.mmtk_plan }}
mmtk_build: ${{ matrix.gc.mmtk_build }}

- name: Install Bundler dependencies
run: bundle install

Expand Down

0 comments on commit 7718266

Please sign in to comment.