1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Migrate Wercker MJIT tests to Actions (#2676)

* Migrate Wercker MJIT tests to Actions

* Support pull request for testing

* Capitalize other jobs too

* Make it a command name for consistency [ci skip]

* Remove wercker.yml

* Add --jit-verbose=2 for debugging

* Install MJIT headers

* Separate install for sudo

* Trigger build
This commit is contained in:
Takashi Kokubun 2019-11-12 21:48:05 -08:00 committed by GitHub
parent c4064aef7f
commit 331655cbe7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
Notes: git 2019-11-13 14:48:29 +09:00
Merged-By: k0kubun <takashikkbn@gmail.com>
11 changed files with 81 additions and 127 deletions

View file

@ -6,7 +6,7 @@
# to prevent us from accidentally pushing commits to GitHub directly.
#
# Details: https://bugs.ruby-lang.org/issues/16094
name: pull_request
name: Pull Request
on: [pull_request]
jobs:
check_branch:

View file

@ -1,4 +1,4 @@
name: macos
name: macOS
on:
push:
branches:

77
.github/workflows/mjit.yml vendored Normal file
View file

@ -0,0 +1,77 @@
name: MJIT
on:
push:
branches:
- master
pull_request:
branches:
- '*'
jobs:
test:
strategy:
matrix:
jit_opts: [ "--jit", "--jit-wait" ]
fail-fast: false
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- name: Install libraries
run: |
set -x
sudo apt-get update -q
sudo apt-get install --no-install-recommends -q -y build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm-dev bison autoconf ruby
# Not using official actions/checkout because it's unstable and sometimes doesn't work for a fork.
- name: Checkout ruby/ruby
run: |
git clone --depth=50 https://github.com/ruby/ruby src
git -C src reset --hard "$GITHUB_SHA"
if: github.event_name == 'push'
- name: Checkout a pull request
run: |
git clone --depth=50 "--branch=$GITHUB_BRANCH" "https://github.com/${GITHUB_REPO}" src
git -C src reset --hard "$GITHUB_REV"
env:
GITHUB_REV: ${{ github.event.pull_request.head.sha }}
GITHUB_BRANCH: ${{ github.event.pull_request.head.ref }}
GITHUB_REPO: ${{ github.event.pull_request.head.repo.full_name }}
if: github.event_name == 'pull_request'
- name: Fixed world writable dirs
run: |
chmod go-w $HOME
sudo chmod -R go-w /usr/share
- name: Set ENV
run: |
echo '::set-env name=JOBS::'-j$((1 + $(nproc --all)))
- name: Autoconf
run: cd src && exec autoconf
- name: configure
run: |
mkdir build
cd build
../src/configure -C --disable-install-doc
- name: make all
run: make -C build $JOBS
- name: make install
run: sudo make -C build $JOBS install
- name: make test
run: "make -C build $JOBS -s test TESTOPTS='-q --tty=no' RUN_OPTS='--disable-gems --jit-warnings ${{ matrix.jit_opts }}'"
- name: make test-all
run: "make -C build $JOBS -s test-all TESTOPTS='-q --tty=no' RUN_OPTS='--disable-gems --jit-warnings ${{ matrix.jit_opts }}'"
- name: make test-spec
run: "make -C build $JOBS -s test-spec RUN_OPTS='--disable-gems --jit-warnings ${{ matrix.jit_opts }}'"
- name: Leaked Globals
run: make -C build -s leaked-globals
- uses: k0kubun/action-slack@v2.0.0
with:
payload: |
{
"attachments": [{
"text": "${{ job.status}}: <https://github.com/${{ github.repository }}/commit/${{ github.sha }}/checks|${{ matrix.os }} / ${{ matrix.test_task }}> " +
"(<https://github.com/${{ github.repository }}/commit/${{ github.sha }}|" + "${{ github.sha }}".substring(0, 10) + ">) " +
"of ${{ github.repository }}@" + "${{ github.ref }}".split('/').reverse()[0] + " by ${{ github.event.head_commit.committer.name }}",
"color": "danger"
}]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
if: failure() && github.event_name == 'push'

View file

@ -1,4 +1,4 @@
name: ubuntu
name: Ubuntu
on:
push:
branches:

View file

@ -1,4 +1,4 @@
name: windows
name: Windows
on:
push:
branches:

View file

@ -1,2 +0,0 @@
# https://app.wercker.com/ruby/ruby/runs/mjit-test2/5bda979a191eda000655a8d2?step=5bda9fe4591ca80007653f64
exclude(:test_frozen, 'somehow FrozenError is not raised with --jit-wait')

View file

@ -1,4 +0,0 @@
# https://app.wercker.com/ruby/ruby/runs/mjit-test2/5c18fd67c0c3d7001190a14d?step=5c18fda8cfa0fc0007fcc633
# https://app.wercker.com/ruby/ruby/runs/mjit-test2/5c1a3db51eea2b000777144a?step=5c1a3def78c72000078df9cf
# https://app.wercker.com/ruby/ruby/runs/mjit-test2/5c1b3a71c0c3d7001191f66e?step=5c1b5ed978c7200007961577
exclude(/./, 'most of tests are too fragile with --jit-wait and this remote fetcher cannot configure timeout')

View file

@ -1,2 +0,0 @@
# https://app.wercker.com/ruby/ruby/runs/test-mjit-wait/5bd040d19b1e440006d52516?step=5bd0410c591ca8000721e3e4
exclude(:test_separate, 'this test randomly fails with --jit-wait')

View file

@ -1,2 +0,0 @@
# https://app.wercker.com/ruby/ruby/runs/test-mjit-wait/5bcfd19aa9806e000655c598?step=5bcfd1d5acc4510006e00f77
exclude(:test_queue_with_trap, 'this test randomly fails with --jit-wait')

View file

@ -1,2 +0,0 @@
# https://app.wercker.com/ruby/ruby/runs/test-mjit/5bcf51409b1e440006d47831?step=5bcf517d87436a000649326d
exclude(:test_queue_with_trap, 'this test fails with --jit')

View file

@ -1,111 +0,0 @@
#
# Wercker is dedicated for testing MJIT. Please use Travis or AppVeyor for non-MJIT testing.
# This runs all Ruby tests with --jit, or --jit-wait which synchronously JITs all methods.
#
box: ruby:2.5-stretch
no-response-timeout: 30
command-timeout: 60
# --jit + --jit-wait (test, test-spec)
mjit-test1:
steps:
- install-packages:
packages: bison sudo
- script:
name: workaround ipv6 localhost
code: ruby -e "hosts = File.read('/etc/hosts').sub(/^::1\s*localhost.*$/, ''); File.write('/etc/hosts', hosts)"
- script:
name: create user # some file permission tests don't succeed with root.
code: useradd --shell /bin/bash --create-home test && chown -R test:test .
- script:
name: configure
code: /usr/bin/sudo -H -u test -- bash -c 'autoconf && ./configure --disable-install-doc --prefix=/tmp/ruby-prefix'
- script:
name: make all install
code: /usr/bin/sudo -H -u test -- make -j$(nproc) all install
- script:
name: install mjit-debug-on-fail
code: |
cat <<'EOS' > /usr/local/bin/mjit-debug-on-fail
#!/bin/bash -x
if ! "$@"; then
git clone --depth=1 git@github.com:ruby/mjit-debug
cd mjit-debug
debug_dir="$(date '+%F_%T')"
mkdir "$debug_dir"
cp /tmp/_ruby_mjit*.c "$debug_dir"
git config --global user.email "ruby@app.wercker.com"
git config --global user.name "Wercker ruby/ruby"
git add "$debug_dir"
git commit -m "Debug ${debug_dir}: ${WERCKER_BUILD_URL}"
git push origin master
exit 1
fi
EOS
chmod +x /usr/local/bin/mjit-debug-on-fail
# git push access to ruby/mjit-debug (private repository)
- add-ssh-key:
keyname: MJIT_DEBUG
host: github.com
- add-to-known_hosts:
hostname: github.com
# --jit
- script:
name: make test (JIT)
code: /usr/bin/sudo -H -u test -- make test RUN_OPTS="--disable-gems --jit --jit-warnings"
- script:
name: make test-spec (JIT)
code: /usr/bin/sudo -H -u test -- make test-spec RUN_OPTS="--disable-gems --jit --jit-warnings"
- script:
name: make test-all (JIT)
code: /usr/local/bin/mjit-debug-on-fail /usr/bin/sudo -H -u test -- make test-all RUN_OPTS="--disable-gems --jit-verbose=1 --jit-save-temps --jit-warnings" TESTOPTS="-v --color=never --job-status=normal --longest 10 --timeout-scale=3.0 --excludes=test/excludes/_wercker/jit"
# --jit-wait (test, test-spec)
- script:
name: make test (JIT wait)
code: /usr/bin/sudo -H -u test -- make test RUN_OPTS="--disable-gems --jit-wait --jit-warnings"
- script:
name: make test-spec (JIT wait)
code: /usr/bin/sudo -H -u test -- make test-spec RUN_OPTS="--disable-gems --jit-wait --jit-warnings"
after-steps:
- wantedly/pretty-slack-notify:
webhook_url: $SLACK_WEBHOOK_URL
username: Wercker mjit-test1
channel: alerts
notify_on: "failed"
branches: ^master$
# --jit-wait (test-all)
mjit-test2:
steps:
- install-packages:
packages: bison sudo
- script:
name: workaround ipv6 localhost
code: ruby -e "hosts = File.read('/etc/hosts').sub(/^::1\s*localhost.*$/, ''); File.write('/etc/hosts', hosts)"
- script:
name: create user # some file permission tests don't succeed with root.
code: useradd --shell /bin/bash --create-home test && chown -R test:test .
- script:
name: configure
code: /usr/bin/sudo -H -u test -- bash -c 'autoconf && ./configure --disable-install-doc --prefix=/tmp/ruby-prefix'
- script:
name: make all install
code: /usr/bin/sudo -H -u test -- make -j$(nproc) all install
# --jit-wait (test-all)
- script:
name: make test-all (JIT wait)
code: /usr/bin/sudo -H -u test -- make test-all RUN_OPTS="--disable-gems --jit-wait --jit-warnings" TESTOPTS="-v --test-order=random --color=never --job-status=normal --timeout-scale=3.0 --excludes=test/excludes/_wercker/jit-wait"
after-steps:
- wantedly/pretty-slack-notify:
webhook_url: $SLACK_WEBHOOK_URL
username: Wercker mjit-test2
channel: alerts
notify_on: "failed"
branches: ^master$