[前][次][番号順一覧][スレッド一覧]

ruby-changes:58769

From: Takashi <ko1@a...>
Date: Wed, 13 Nov 2019 14:48:29 +0900 (JST)
Subject: [ruby-changes:58769] 331655cbe7 (master): Migrate Wercker MJIT tests to Actions (#2676)

https://git.ruby-lang.org/ruby.git/commit/?id=331655cbe7

From 331655cbe7139a287267c90b3ab46ed856aebb5b Mon Sep 17 00:00:00 2001
From: Takashi Kokubun <takashikkbn@g...>
Date: Tue, 12 Nov 2019 21:48:05 -0800
Subject: 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

diff --git a/.github/workflows/check_branch.yml b/.github/workflows/check_branch.yml
index 4a74cbd..37cf3a9 100644
--- a/.github/workflows/check_branch.yml
+++ b/.github/workflows/check_branch.yml
@@ -6,7 +6,7 @@ https://github.com/ruby/ruby/blob/trunk/.github/workflows/check_branch.yml#L6
 # 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:
diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml
index d7437a2..b0cd602 100644
--- a/.github/workflows/macos.yml
+++ b/.github/workflows/macos.yml
@@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/.github/workflows/macos.yml#L1
-name: macos
+name: macOS
 on:
   push:
     branches:
diff --git a/.github/workflows/mjit.yml b/.github/workflows/mjit.yml
new file mode 100644
index 0000000..39a05ae
--- /dev/null
+++ b/.github/workflows/mjit.yml
@@ -0,0 +1,77 @@ https://github.com/ruby/ruby/blob/trunk/.github/workflows/mjit.yml#L1
+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@v...
+        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'
diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml
index 1a59bc3..847e4a1 100644
--- a/.github/workflows/ubuntu.yml
+++ b/.github/workflows/ubuntu.yml
@@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/.github/workflows/ubuntu.yml#L1
-name: ubuntu
+name: Ubuntu
 on:
   push:
     branches:
diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml
index efa371d..8dd546b 100644
--- a/.github/workflows/windows.yml
+++ b/.github/workflows/windows.yml
@@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/.github/workflows/windows.yml#L1
-name: windows
+name: Windows
 on:
   push:
     branches:
diff --git a/test/excludes/_wercker/jit-wait/TestDelegateClass.rb b/test/excludes/_wercker/jit-wait/TestDelegateClass.rb
deleted file mode 100644
index 384bb03..0000000
--- a/test/excludes/_wercker/jit-wait/TestDelegateClass.rb
+++ /dev/null
@@ -1,2 +0,0 @@ https://github.com/ruby/ruby/blob/trunk/.github/workflows/windows.yml#L0
-# https://app.wercker.com/ruby/ruby/runs/mjit-test2/5bda979a191eda000655a8d2?step=5bda9fe4591ca80007653f64
-exclude(:test_frozen, 'somehow FrozenError is not raised with --jit-wait')
diff --git a/test/excludes/_wercker/jit-wait/TestGemRemoteFetcher.rb b/test/excludes/_wercker/jit-wait/TestGemRemoteFetcher.rb
deleted file mode 100644
index 30ece81..0000000
--- a/test/excludes/_wercker/jit-wait/TestGemRemoteFetcher.rb
+++ /dev/null
@@ -1,4 +0,0 @@ https://github.com/ruby/ruby/blob/trunk/.github/workflows/windows.yml#L0
-# 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')
diff --git a/test/excludes/_wercker/jit-wait/TestParallel/TestParallel.rb b/test/excludes/_wercker/jit-wait/TestParallel/TestParallel.rb
deleted file mode 100644
index e241a78..0000000
--- a/test/excludes/_wercker/jit-wait/TestParallel/TestParallel.rb
+++ /dev/null
@@ -1,2 +0,0 @@ https://github.com/ruby/ruby/blob/trunk/.github/workflows/windows.yml#L0
-# https://app.wercker.com/ruby/ruby/runs/test-mjit-wait/5bd040d19b1e440006d52516?step=5bd0410c591ca8000721e3e4
-exclude(:test_separate, 'this test randomly fails with --jit-wait')
diff --git a/test/excludes/_wercker/jit-wait/TestThreadQueue.rb b/test/excludes/_wercker/jit-wait/TestThreadQueue.rb
deleted file mode 100644
index 5d0ba88..0000000
--- a/test/excludes/_wercker/jit-wait/TestThreadQueue.rb
+++ /dev/null
@@ -1,2 +0,0 @@ https://github.com/ruby/ruby/blob/trunk/.github/workflows/windows.yml#L0
-# 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')
diff --git a/test/excludes/_wercker/jit/TestThreadQueue.rb b/test/excludes/_wercker/jit/TestThreadQueue.rb
deleted file mode 100644
index 2a968ab..0000000
--- a/test/excludes/_wercker/jit/TestThreadQueue.rb
+++ /dev/null
@@ -1,2 +0,0 @@ https://github.com/ruby/ruby/blob/trunk/.github/workflows/windows.yml#L0
-# https://app.wercker.com/ruby/ruby/runs/test-mjit/5bcf51409b1e440006d47831?step=5bcf517d87436a000649326d
-exclude(:test_queue_with_trap, 'this test fails with --jit')
diff --git a/wercker.yml b/wercker.yml
deleted file mode 100644
index c8b2525..0000000
--- a/wercker.yml
+++ /dev/null
@@ -1,111 +0,0 @@ https://github.com/ruby/ruby/blob/trunk/.github/workflows/windows.yml#L0
-#
-# 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@g...: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  (... truncated)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]