summaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/annocheck.yml181
-rw-r--r--.github/workflows/auto_request_review.yml4
-rw-r--r--.github/workflows/baseruby.yml67
-rw-r--r--.github/workflows/bundled_gems.yml117
-rw-r--r--.github/workflows/check_dependencies.yml73
-rw-r--r--.github/workflows/check_misc.yml69
-rw-r--r--.github/workflows/cirrus-notify.yml46
-rw-r--r--.github/workflows/codeql-analysis.yml158
-rw-r--r--.github/workflows/compilers.yml179
-rw-r--r--.github/workflows/dependabot_automerge.yml12
-rw-r--r--.github/workflows/macos.yml188
-rw-r--r--.github/workflows/mingw.yml139
-rw-r--r--.github/workflows/pr-playground.yml127
-rw-r--r--.github/workflows/prism.yml117
-rw-r--r--.github/workflows/rjit-bindgen.yml90
-rw-r--r--.github/workflows/rjit.yml102
-rw-r--r--.github/workflows/scorecards.yml12
-rw-r--r--.github/workflows/spec_guards.yml41
-rw-r--r--.github/workflows/ubuntu.yml179
-rw-r--r--.github/workflows/wasm.yml125
-rw-r--r--.github/workflows/windows.yml169
-rw-r--r--.github/workflows/yjit-macos.yml170
-rw-r--r--.github/workflows/yjit-ubuntu.yml218
23 files changed, 1538 insertions, 1045 deletions
diff --git a/.github/workflows/annocheck.yml b/.github/workflows/annocheck.yml
index 7c26f9276d..1c70089cb5 100644
--- a/.github/workflows/annocheck.yml
+++ b/.github/workflows/annocheck.yml
@@ -4,157 +4,108 @@ on:
push:
paths-ignore:
- 'doc/**'
- - '**/man'
+ - '**/man/*'
- '**.md'
- '**.rdoc'
- '**/.document'
+ - '.*.yml'
pull_request:
paths-ignore:
- 'doc/**'
- - '**/man'
+ - '**/man/*'
- '**.md'
- '**.rdoc'
- '**/.document'
+ - '.*.yml'
merge_group:
- paths-ignore:
- - 'doc/**'
- - '**/man'
- - '**.md'
- - '**.rdoc'
- - '**/.document'
concurrency:
group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }}
cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }}
-# GitHub actions does not support YAML anchors. This creative use of
-# environment variables (plus the "echo $GITHUB_ENV" hack) is to reroute that
-# restriction.
-env:
- default_cc: clang-15
- append_cc: ''
-
- # -O1 is faster than -O3 in our tests... Majority of time are consumed trying
- # to optimize binaries. Also GitHub Actions run on relatively modern CPUs
- # compared to, say, GCC 4 or Clang 3. We don't specify `-march=native`
- # because compilers tend not understand what the CPU is.
- optflags: '-O1'
-
- # -g0 disables backtraces when SEGV. Do not set that.
- debugflags: '-ggdb3'
-
- default_configure: >-
- --enable-debug-env
- --disable-install-doc
- --with-ext=-test-/cxxanyargs,+
- append_configure: >-
- --without-valgrind
- --without-jemalloc
- --without-gmp
-
- CONFIGURE_TTY: never
- GITPULLOPTIONS: --no-tags origin ${{github.ref}}
- RUBY_DEBUG: ci rgengc
- RUBY_TESTOPTS: >-
- -q
- --color=always
- --tty=no
-
permissions:
contents: read
jobs:
compile:
- strategy:
- fail-fast: false
- matrix:
- env:
- - {}
- entry:
- - name: 'gcc-11 annocheck'
- container: gcc-11
- env:
- # Minimal flags to pass the check.
- default_cc: 'gcc-11 -fcf-protection -Wa,--generate-missing-build-notes=yes'
- optflags: '-O2'
- LDFLAGS: '-Wl,-z,now'
- # FIXME: Drop skipping options
- # https://bugs.ruby-lang.org/issues/18061
- # https://sourceware.org/annobin/annobin.html/Test-pie.html
- TEST_ANNOCHECK_OPTS: "--skip-pie --skip-gaps"
- check: true
-
- name: ${{ matrix.entry.name }}
+ name: test-annocheck
+
runs-on: ubuntu-latest
+
container:
- image: ghcr.io/ruby/ruby-ci-image:${{ matrix.entry.container || matrix.entry.env.default_cc || 'clang-15' }}
+ image: ghcr.io/ruby/ruby-ci-image:gcc-11
options: --user root
- if: ${{ !contains(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }}
- env: ${{ matrix.entry.env || matrix.env }}
+
+ if: >-
+ ${{!(false
+ || contains(github.event.head_commit.message, '[DOC]')
+ || contains(github.event.head_commit.message, 'Document')
+ || contains(github.event.pull_request.title, '[DOC]')
+ || contains(github.event.pull_request.title, 'Document')
+ || contains(github.event.pull_request.labels.*.name, 'Document')
+ || (github.event_name == 'push' && github.actor == 'dependabot[bot]')
+ )}}
+
+ env:
+ CONFIGURE_TTY: never
+ GITPULLOPTIONS: --no-tags origin ${{ github.ref }}
+ RUBY_DEBUG: ci rgengc
+ RUBY_TESTOPTS: >-
+ -q
+ --color=always
+ --tty=no
+ # FIXME: Drop skipping options
+ # https://bugs.ruby-lang.org/issues/18061
+ # https://sourceware.org/annobin/annobin.html/Test-pie.html
+ TEST_ANNOCHECK_OPTS: '--skip-pie --skip-gaps'
+
steps:
- run: id
working-directory:
- - run: mkdir build
- working-directory:
- - name: setenv
- run: |
- echo "GNUMAKEFLAGS=-sj$((1 + $(nproc --all)))" >> $GITHUB_ENV
- - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
+
+ - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ with:
+ sparse-checkout-cone-mode: false
+ sparse-checkout: /.github
+
+ - uses: ./.github/actions/setup/directories
with:
- path: src
- - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
+ srcdir: src
+ builddir: build
+ makeup: true
+
+ - uses: ruby/setup-ruby@3783f195e29b74ae398d7caca108814bbafde90e # v1.180.1
with:
- path: src/.downloaded-cache
- key: downloaded-cache
- - name: autogen
- run: |
- if [ ! -f ./autogen.sh ]; then
- ls -la
- fi
- ./autogen.sh
- working-directory: src
+ ruby-version: '3.0'
+ bundler: none
+
+ # Minimal flags to pass the check.
+ # -g0 disables backtraces when SEGV. Do not set that.
- name: Run configure
run: >
- ../src/configure -C ${default_configure} ${append_configure}
- --${{
- matrix.entry.crosshost && 'host' || 'with-gcc'
- }}=${{
- matrix.entry.crosshost || '"${default_cc}${append_cc:+ $append_cc}"'
- }}
- --${{ matrix.entry.shared || 'enable' }}-shared
- - run: make extract-extlibs
- - run: make incs
+ ../src/configure -C
+ --enable-debug-env
+ --disable-install-doc
+ --with-ext=-test-/cxxanyargs,+
+ --without-valgrind
+ --without-jemalloc
+ --without-gmp
+ --with-gcc="gcc-11 -fcf-protection -Wa,--generate-missing-build-notes=yes"
+ --enable-shared
+ debugflags=-ggdb3
+ optflags=-O2
+ LDFLAGS=-Wl,-z,now
+
- run: make showflags
+
- run: make
- - run: make test
- - run: make install
- if: ${{ matrix.entry.check }}
- - run: make test-tool
- if: ${{ matrix.entry.check }}
- ### test-all doesn't work: https://github.com/ruby/ruby/actions/runs/4340112185/jobs/7578344307
- # - run: make test-all TESTS='-- ruby -ext-'
- # if: ${{ matrix.entry.check }}
- ### test-spec doesn't work: https://github.com/ruby/ruby/actions/runs/4340193212/jobs/7578505652
- # - run: make test-spec
- # env:
- # CHECK_LEAKS: true
- # if: ${{ matrix.entry.check }}
+
- run: make test-annocheck
- if: ${{ matrix.entry.check && endsWith(matrix.entry.name, 'annocheck') }}
- - uses: ruby/action-slack@0bd85c72233cdbb6a0fe01d37aaeff1d21b5fce1 # v3.2.1
+ - uses: ./.github/actions/slack
with:
- payload: |
- {
- "ci": "GitHub Actions",
- "env": "${{ github.workflow }} / ${{ matrix.entry.name }}",
- "url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
- "commit": "${{ github.sha }}",
- "branch": "${{ github.ref_name }}"
- }
- env:
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
- if: ${{ failure() && github.event_name == 'push' }}
+ if: ${{ failure() }}
defaults:
run:
diff --git a/.github/workflows/auto_request_review.yml b/.github/workflows/auto_request_review.yml
index d9eb774e3f..ca27244b46 100644
--- a/.github/workflows/auto_request_review.yml
+++ b/.github/workflows/auto_request_review.yml
@@ -10,10 +10,10 @@ jobs:
auto-request-review:
name: Auto Request Review
runs-on: ubuntu-latest
- if: ${{ github.repository == 'ruby/ruby' }}
+ if: ${{ github.repository == 'ruby/ruby' && github.base_ref == 'master' }}
steps:
- name: Request review based on files changes and/or groups the author belongs to
- uses: necojackarc/auto-request-review@6a51cebffe2c084705d9a7b394abd802e0119633 # v0.12.0
+ uses: necojackarc/auto-request-review@e89da1a8cd7c8c16d9de9c6e763290b6b0e3d424 # v0.13.0
with:
# scope: public_repo
token: ${{ secrets.MATZBOT_GITHUB_TOKEN }}
diff --git a/.github/workflows/baseruby.yml b/.github/workflows/baseruby.yml
index 9c38e0998b..f406fb1ac2 100644
--- a/.github/workflows/baseruby.yml
+++ b/.github/workflows/baseruby.yml
@@ -4,24 +4,20 @@ on:
push:
paths-ignore:
- 'doc/**'
- - '**/man'
+ - '**/man/*'
- '**.md'
- '**.rdoc'
- '**/.document'
+ - '.*.yml'
pull_request:
paths-ignore:
- 'doc/**'
- - '**/man'
+ - '**/man/*'
- '**.md'
- '**.rdoc'
- '**/.document'
+ - '.*.yml'
merge_group:
- paths-ignore:
- - 'doc/**'
- - '**/man'
- - '**.md'
- - '**.rdoc'
- - '**/.document'
concurrency:
group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }}
@@ -33,46 +29,49 @@ permissions:
jobs:
baseruby:
name: BASERUBY
+
runs-on: ubuntu-20.04
- if: ${{ !contains(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }}
+
+ if: >-
+ ${{!(false
+ || contains(github.event.head_commit.message, '[DOC]')
+ || contains(github.event.head_commit.message, 'Document')
+ || contains(github.event.pull_request.title, '[DOC]')
+ || contains(github.event.pull_request.title, 'Document')
+ || contains(github.event.pull_request.labels.*.name, 'Document')
+ || (github.event_name == 'push' && github.actor == 'dependabot[bot]')
+ )}}
+
strategy:
matrix:
ruby:
- - ruby-2.5
-# - ruby-2.6
-# - ruby-2.7
- ruby-3.0
- ruby-3.1
- ruby-3.2
+ - ruby-3.3
steps:
- - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
- with:
- path: .downloaded-cache
- key: downloaded-cache
- - uses: ruby/setup-ruby@8a45918450651f5e4784b6031db26f4b9f76b251 # v1.150.0
+ - uses: ruby/setup-ruby@3783f195e29b74ae398d7caca108814bbafde90e # v1.180.1
with:
ruby-version: ${{ matrix.ruby }}
bundler: none
- - run: echo "GNUMAKEFLAGS=-j$((1 + $(nproc --all)))" >> $GITHUB_ENV
- - run: sudo apt-get install build-essential autoconf libyaml-dev
- - run: ./autogen.sh
+
+ - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+
+ - uses: ./.github/actions/setup/ubuntu
+
+ - uses: ./.github/actions/setup/directories
+ with:
+ makeup: true
+
- run: ./configure --disable-install-doc
- - run: make common-srcs
- - run: make incs
+
- run: make all
+
- run: make test
- - uses: ruby/action-slack@0bd85c72233cdbb6a0fe01d37aaeff1d21b5fce1 # v3.2.1
+
+ - uses: ./.github/actions/slack
with:
- payload: |
- {
- "ci": "GitHub Actions",
- "env": "${{ github.workflow }} / BASERUBY @ ${{ matrix.ruby }}",
- "url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
- "commit": "${{ github.sha }}",
- "branch": "${{ github.ref_name }}"
- }
- env:
+ label: ${{ matrix.ruby }}
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
- if: ${{ failure() && github.event_name == 'push' }}
+ if: ${{ failure() }}
diff --git a/.github/workflows/bundled_gems.yml b/.github/workflows/bundled_gems.yml
index c871388f93..feafb9bca8 100644
--- a/.github/workflows/bundled_gems.yml
+++ b/.github/workflows/bundled_gems.yml
@@ -2,54 +2,48 @@ name: bundled_gems
on:
push:
- branches: [ "master" ]
+ branches: ['master']
paths:
- '.github/workflows/bundled_gems.yml'
- 'gems/bundled_gems'
pull_request:
- branches: [ "master" ]
+ branches: ['master']
paths:
- '.github/workflows/bundled_gems.yml'
- 'gems/bundled_gems'
merge_group:
- branches: [ "master" ]
- paths:
- - '.github/workflows/bundled_gems.yml'
- - 'gems/bundled_gems'
schedule:
- cron: '45 6 * * *'
workflow_dispatch:
-permissions: # added using https://github.com/step-security/secure-workflows
+permissions: # added using https://github.com/step-security/secure-workflows
contents: read
jobs:
update:
permissions:
- contents: write # for Git to git push
+ contents: write # for Git to git push
+
if: ${{ github.event_name != 'schedule' || github.repository == 'ruby/ruby' }}
+
name: update ${{ github.workflow }}
+
runs-on: ubuntu-latest
+
steps:
- - name: git config
- run: |
- git config --global advice.detachedHead 0
- git config --global init.defaultBranch garbage
+ - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ with:
+ token: ${{ (github.repository == 'ruby/ruby' && !startsWith(github.event_name, 'pull')) && secrets.MATZBOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
+
+ - uses: ./.github/actions/setup/directories
+ with:
+ # Skip overwriting MATZBOT_GITHUB_TOKEN
+ checkout: '' # false (ref: https://github.com/actions/runner/issues/2238)
- name: Set ENV
run: |
- echo "GNUMAKEFLAGS=-j$((1 + $(nproc --all)))" >> $GITHUB_ENV
echo "TODAY=$(date +%F)" >> $GITHUB_ENV
- - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
-
- - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
- with:
- path: .downloaded-cache
- key: downloaded-cache-${{ github.sha }}
- restore-keys: |
- downloaded-cache
-
- name: Download previous gems list
run: |
data=bundled_gems.json
@@ -58,8 +52,16 @@ jobs:
curl -O -R -z ./$data https://stdgems.org/$data
- name: Update bundled gems list
+ id: bundled_gems
+ run: |
+ ruby -i~ tool/update-bundled_gems.rb gems/bundled_gems >> $GITHUB_OUTPUT
+
+ - name: Update spec/bundler/support/builders.rb
run: |
- ruby -i~ tool/update-bundled_gems.rb gems/bundled_gems
+ #!ruby
+ rake_version = File.read("gems/bundled_gems")[/^rake\s+(\S+)/, 1]
+ print ARGF.read.sub(/^ *def rake_version\s*\K".*?"/) {rake_version.dump}
+ shell: ruby -i~ {0} spec/bundler/support/builders.rb
- name: Maintain updated gems list in NEWS
run: |
@@ -68,71 +70,66 @@ jobs:
- name: Check diffs
id: diff
run: |
- git add -- NEWS.md
- git diff --no-ext-diff --ignore-submodules --quiet -- gems/bundled_gems
- continue-on-error: true
+ news= gems=
+ git diff --color --no-ext-diff --ignore-submodules --exit-code -- NEWS.md ||
+ news=true
+ git diff --color --no-ext-diff --ignore-submodules --exit-code -- gems/bundled_gems ||
+ gems=true
+ git add -- NEWS.md gems/bundled_gems
+ git add -- spec/bundler/support/builders.rb
+ echo news=$news >> $GITHUB_OUTPUT
+ echo gems=$gems >> $GITHUB_OUTPUT
+ echo update=${news:-$gems} >> $GITHUB_OUTPUT
- 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 autoconf ruby
- if: ${{ steps.diff.outcome == 'failure' }}
+ uses: ./.github/actions/setup/ubuntu
+ if: ${{ steps.diff.outputs.gems }}
- name: Build
run: |
./autogen.sh
./configure -C --disable-install-doc
make
- if: ${{ steps.diff.outcome == 'failure' }}
+ if: ${{ steps.diff.outputs.gems }}
- name: Prepare bundled gems
run: |
make -s prepare-gems
- if: ${{ steps.diff.outcome == 'failure' }}
+ if: ${{ steps.diff.outputs.gems }}
- name: Test bundled gems
run: |
make -s test-bundled-gems
- git add -- gems/bundled_gems
timeout-minutes: 30
env:
- RUBY_TESTOPTS: "-q --tty=no"
- TEST_BUNDLED_GEMS_ALLOW_FAILURES: ""
- if: ${{ steps.diff.outcome == 'failure' }}
-
- - name: Show diffs
- id: show
- run: |
- git diff --cached --color --no-ext-diff --ignore-submodules --exit-code --
- continue-on-error: true
+ RUBY_TESTOPTS: '-q --tty=no'
+ TEST_BUNDLED_GEMS_ALLOW_FAILURES: ''
+ if: ${{ steps.diff.outputs.gems }}
- name: Commit
run: |
git pull --ff-only origin ${GITHUB_REF#refs/heads/}
- message="Update bundled gems list at "
- if [ ${{ steps.diff.outcome }} = success ]; then
- git commit --message="${message}${GITHUB_SHA:0:30} [ci skip]"
+ message="Update bundled gems list"
+ if [ -z "${gems}" ]; then
+ git commit --message="${message} at ${GITHUB_SHA:0:30} [ci skip]"
else
- git commit --message="${message}${TODAY}"
+ git commit --message="${message} as of ${TODAY}"
fi
git push origin ${GITHUB_REF#refs/heads/}
env:
+ TODAY: ${{ steps.bundled_gems.outputs.latest_date || env.TODAY }}
EMAIL: svn-admin@ruby-lang.org
GIT_AUTHOR_NAME: git
GIT_COMMITTER_NAME: git
- if: ${{ github.repository == 'ruby/ruby' && !startsWith(github.event_name, 'pull') && steps.show.outcome == 'failure' }}
-
- - uses: ruby/action-slack@0bd85c72233cdbb6a0fe01d37aaeff1d21b5fce1 # v3.2.1
+ gems: ${{ steps.diff.outputs.gems }}
+ if: >-
+ ${{
+ github.repository == 'ruby/ruby' &&
+ !startsWith(github.event_name, 'pull') &&
+ steps.diff.outputs.update
+ }}
+
+ - uses: ./.github/actions/slack
with:
- payload: |
- {
- "ci": "GitHub Actions",
- "env": "${{ github.workflow }} / update",
- "url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
- "commit": "${{ github.sha }}",
- "branch": "${{ github.ref_name }}"
- }
- env:
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
- if: ${{ failure() && github.event_name == 'push' }}
+ if: ${{ failure() }}
diff --git a/.github/workflows/check_dependencies.yml b/.github/workflows/check_dependencies.yml
index 642c3255ce..a9bc835843 100644
--- a/.github/workflows/check_dependencies.yml
+++ b/.github/workflows/check_dependencies.yml
@@ -3,24 +3,20 @@ on:
push:
paths-ignore:
- 'doc/**'
- - '**/man'
+ - '**/man/*'
- '**.md'
- '**.rdoc'
- '**/.document'
+ - '.*.yml'
pull_request:
paths-ignore:
- 'doc/**'
- - '**/man'
+ - '**/man/*'
- '**.md'
- '**.rdoc'
- '**/.document'
+ - '.*.yml'
merge_group:
- paths-ignore:
- - 'doc/**'
- - '**/man'
- - '**.md'
- - '**.rdoc'
- - '**/.document'
concurrency:
group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }}
@@ -35,45 +31,46 @@ jobs:
matrix:
os: [ubuntu-20.04]
fail-fast: true
+
runs-on: ${{ matrix.os }}
- if: ${{ !contains(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }}
+
+ if: >-
+ ${{!(false
+ || contains(github.event.head_commit.message, '[DOC]')
+ || contains(github.event.head_commit.message, 'Document')
+ || contains(github.event.pull_request.title, '[DOC]')
+ || contains(github.event.pull_request.title, 'Document')
+ || contains(github.event.pull_request.labels.*.name, 'Document')
+ || (github.event_name == 'push' && github.actor == 'dependabot[bot]')
+ )}}
+
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 autoconf ruby
+ - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+
+ - uses: ./.github/actions/setup/ubuntu
if: ${{ contains(matrix.os, 'ubuntu') }}
- - name: Install libraries
- run: |
- brew upgrade
- brew install gmp libffi openssl@1.1 zlib autoconf automake libtool readline
+
+ - uses: ./.github/actions/setup/macos
if: ${{ contains(matrix.os, 'macos') }}
- - name: git config
- run: |
- git config --global advice.detachedHead 0
- git config --global init.defaultBranch garbage
- - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
+
+ - uses: ./.github/actions/setup/directories
+
+ - uses: ruby/setup-ruby@3783f195e29b74ae398d7caca108814bbafde90e # v1.180.1
with:
- path: .downloaded-cache
- key: downloaded-cache
- - run: ./autogen.sh
+ ruby-version: '3.0'
+ bundler: none
+
- name: Run configure
run: ./configure -C --disable-install-doc --disable-rubygems --with-gcc 'optflags=-O0' 'debugflags=-save-temps=obj -g'
+
- run: make all golf
+
- run: ruby tool/update-deps --fix
+
- run: git diff --no-ext-diff --ignore-submodules --exit-code
- - uses: ruby/action-slack@0bd85c72233cdbb6a0fe01d37aaeff1d21b5fce1 # v3.2.1
+
+ - uses: ./.github/actions/slack
with:
- payload: |
- {
- "ci": "GitHub Actions",
- "env": "${{ matrix.os }} / Dependencies need to update",
- "url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
- "commit": "${{ github.sha }}",
- "branch": "${{ github.ref_name }}"
- }
- env:
+ label: ${{ matrix.os }} / Dependencies need to update
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
- if: ${{ failure() && github.event_name == 'push' }}
+ if: ${{ failure() }}
diff --git a/.github/workflows/check_misc.yml b/.github/workflows/check_misc.yml
index 403fa26d1f..a4317595f4 100644
--- a/.github/workflows/check_misc.yml
+++ b/.github/workflows/check_misc.yml
@@ -1,4 +1,4 @@
-name: Miscellaneous checks
+name: Misc
on: [push, pull_request, merge_group]
concurrency:
@@ -10,21 +10,37 @@ permissions:
jobs:
checks:
+ name: Miscellaneous checks
+
permissions:
- contents: write # for Git to git push
+ contents: write # for Git to git push
+
runs-on: ubuntu-latest
+
steps:
- - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
+ - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ with:
+ token: ${{ (github.repository == 'ruby/ruby' && !startsWith(github.event_name, 'pull')) && secrets.MATZBOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
+
+ - uses: ./.github/actions/setup/directories
+ with:
+ makeup: true
+ # Skip overwriting MATZBOT_GITHUB_TOKEN
+ checkout: '' # false (ref: https://github.com/actions/runner/issues/2238)
+
- name: Check if C-sources are US-ASCII
run: |
- grep -r -n '[^ -~]' -- *.[chy] include internal win32/*.[ch] && exit 1 || :
+ grep -r -n --include='*.[chyS]' --include='*.asm' $'[^\t-~]' -- . && exit 1 || :
+
- name: Check for trailing spaces
run: |
- git grep -I -n '[ ]$' -- '*.rb' '*.[chy]' '*.rs' && exit 1 || :
- git grep -n '^[ ][ ]*$' -- '*.md' && exit 1 || :
+ git grep -I -n $'[\t ]$' -- '*.rb' '*.[chy]' '*.rs' '*.yml' && exit 1 || :
+ git grep -n $'^[\t ][\t ]*$' -- '*.md' && exit 1 || :
+
- name: Check for bash specific substitution in configure.ac
run: |
git grep -n '\${[A-Za-z_0-9]*/' -- configure.ac && exit 1 || :
+
- name: Check for header macros
run: |
fail=
@@ -40,21 +56,13 @@ jobs:
run: true
if: ${{ github.ref == 'refs/heads/master' }}
- - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
- with:
- path: .downloaded-cache
- key: downloaded-cache-${{ github.sha }}
- restore-keys: |
- downloaded-cache
- if: steps.gems.outcome == 'success'
-
- name: Download previous gems list
run: |
data=default_gems.json
mkdir -p .downloaded-cache
ln -s .downloaded-cache/$data .
curl -O -R -z ./$data https://stdgems.org/$data
- if: steps.gems.outcome == 'success'
+ if: ${{ steps.gems.outcome == 'success' }}
- name: Make default gems list
run: |
@@ -73,19 +81,20 @@ jobs:
f.puts gems
end
shell: ruby --disable=gems {0}
- if: steps.gems.outcome == 'success'
+ if: ${{ steps.gems.outcome == 'success' }}
- name: Maintain updated gems list in NEWS
run: |
ruby tool/update-NEWS-gemlist.rb default
- if: steps.gems.outcome == 'success'
+ if: ${{ steps.gems.outcome == 'success' }}
- name: Check diffs
id: diff
run: |
- git diff --color --no-ext-diff --ignore-submodules --exit-code NEWS.md
- continue-on-error: true
- if: steps.gems.outcome == 'success'
+ git diff --color --no-ext-diff --ignore-submodules --exit-code NEWS.md ||
+ echo update=true >> $GITHUB_OUTPUT
+ if: ${{ steps.gems.outcome == 'success' }}
+
- name: Commit
run: |
git pull --ff-only origin ${GITHUB_REF#refs/heads/}
@@ -95,18 +104,14 @@ jobs:
EMAIL: svn-admin@ruby-lang.org
GIT_AUTHOR_NAME: git
GIT_COMMITTER_NAME: git
- if: ${{ github.repository == 'ruby/ruby' && !startsWith(github.event_name, 'pull') && steps.diff.outcome == 'failure' }}
+ if: >-
+ ${{
+ github.repository == 'ruby/ruby' &&
+ !startsWith(github.event_name, 'pull') &&
+ steps.diff.outputs.update
+ }}
- - uses: ruby/action-slack@0bd85c72233cdbb6a0fe01d37aaeff1d21b5fce1 # v3.2.1
+ - uses: ./.github/actions/slack
with:
- payload: |
- {
- "ci": "GitHub Actions",
- "env": "${{ github.workflow }}",
- "url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
- "commit": "${{ github.sha }}",
- "branch": "${{ github.ref_name }}"
- }
- env:
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
- if: ${{ failure() && github.event_name == 'push' }}
+ if: ${{ failure() }}
diff --git a/.github/workflows/cirrus-notify.yml b/.github/workflows/cirrus-notify.yml
deleted file mode 100644
index f6c11a65d3..0000000000
--- a/.github/workflows/cirrus-notify.yml
+++ /dev/null
@@ -1,46 +0,0 @@
-on:
- check_suite:
- type: ['completed']
-name: Cirrus CI failure notification
-
-permissions:
- contents: read
-
-jobs:
- cirrus-notify:
- name: After Cirrus CI Failure
- if: >-
- github.event.check_suite.app.name == 'Cirrus CI'
- && github.event.check_suite.conclusion != 'success'
- && github.event.check_suite.conclusion != 'cancelled'
- && github.event.check_suite.conclusion != 'skipped'
- && github.event.check_suite.head_branch == 'master'
- runs-on: ubuntu-latest
- steps:
- - uses: octokit/request-action@352d2ae93e1805721b5fe308598555ba3bd2c8e2 # v2.1.8
- id: get_failed_check_run
- with:
- route: GET /repos/${{ github.repository }}/check-suites/${{ github.event.check_suite.id }}/check-runs?status=completed
- mediaType: '{"previews": ["antiope"]}'
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- - name: Dump GitHub context
- env:
- GITHUB_CONTEXT: ${{ toJson(github) }}
- run: echo "$GITHUB_CONTEXT"
- - name: Dump check_runs
- env:
- CHECK_RUNS: ${{ steps.get_failed_check_run.outputs.data }}
- run: echo "$CHECK_RUNS"
- - uses: ruby/action-slack@0bd85c72233cdbb6a0fe01d37aaeff1d21b5fce1 # v3.2.1
- with:
- payload: |
- {
- "ci": "Cirrus CI",
- "env": "Cirrus CI",
- "url": "${{ fromJson(steps.get_failed_check_run.outputs.data).check_runs[0].html_url }}",
- "commit": "${{ github.event.check_suite.head_commit.id }}",
- "branch": "${{ github.event.check_suite.head_branch }}"
- }
- env:
- SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index e250835aa2..e7ddcae435 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -1,21 +1,23 @@
-name: "CodeQL"
+name: 'CodeQL'
on:
push:
- branches: [ "master" ]
+ branches: ['master']
paths-ignore:
- 'doc/**'
- - '**/man'
+ - '**/man/*'
- '**.md'
- '**.rdoc'
- '**/.document'
+ - '.*.yml'
pull_request:
paths-ignore:
- 'doc/**'
- - '**/man'
+ - '**/man/*'
- '**.md'
- '**.rdoc'
- '**/.document'
+ - '.*.yml'
schedule:
- cron: '0 12 * * *'
workflow_dispatch:
@@ -24,19 +26,27 @@ concurrency:
group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }}
cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }}
-permissions: # added using https://github.com/step-security/secure-workflows
+permissions: # added using https://github.com/step-security/secure-workflows
contents: read
jobs:
analyze:
name: Analyze
- runs-on: ubuntu-latest
+ runs-on: ${{ matrix.os }}
permissions:
- actions: read # for github/codeql-action/init to get workflow details
- contents: read # for actions/checkout to fetch code
- security-events: write # for github/codeql-action/autobuild to send a status report
+ actions: read # for github/codeql-action/init to get workflow details
+ contents: read # for actions/checkout to fetch code
+ security-events: write # for github/codeql-action/autobuild to send a status report
# CodeQL fails to run pull requests from dependabot due to missing write access to upload results.
- if: ${{ !contains(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') && github.event.head_commit.pusher.name != 'dependabot[bot]' }}
+ if: >-
+ ${{!(false
+ || contains(github.event.head_commit.message, '[DOC]')
+ || contains(github.event.head_commit.message, 'Document')
+ || contains(github.event.pull_request.title, '[DOC]')
+ || contains(github.event.pull_request.title, 'Document')
+ || contains(github.event.pull_request.labels.*.name, 'Document')
+ || (github.event_name == 'push' && github.actor == 'dependabot[bot]')
+ )}}
env:
enable_install_doc: no
@@ -44,67 +54,71 @@ jobs:
strategy:
fail-fast: false
matrix:
- language: [ 'cpp', 'ruby' ]
+ include:
+ - language: cpp
+ os: ubuntu-latest
+ # ruby analysis used large memory. We need to use a larger runner.
+ - language: ruby
+ os: ${{ github.repository == 'ruby/ruby' && 'macos-arm-oss' || 'ubuntu-latest' }}
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 autoconf ruby
-
- - name: Checkout repository
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
-
- - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
- with:
- path: .downloaded-cache
- key: downloaded-cache
-
- - name: Remove an obsolete rubygems vendored file
- run: sudo rm /usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb
-
- - name: Initialize CodeQL
- uses: github/codeql-action/init@0225834cc549ee0ca93cb085b92954821a145866 # v2.3.5
- with:
- languages: ${{ matrix.language }}
-
- - name: Set ENV
- run: echo "GNUMAKEFLAGS=-j$((1 + $(nproc --all)))" >> $GITHUB_ENV
-
- - name: Autobuild
- uses: github/codeql-action/autobuild@0225834cc549ee0ca93cb085b92954821a145866 # v2.3.5
-
- - name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@0225834cc549ee0ca93cb085b92954821a145866 # v2.3.5
- with:
- category: "/language:${{matrix.language}}"
- upload: False
- output: sarif-results
-
- - name: filter-sarif
- uses: advanced-security/filter-sarif@f3b8118a9349d88f7b1c0c488476411145b6270d # v1.0
- with:
- patterns: |
- +**/*.rb
- -lib/uri/mailto.rb:rb/overly-large-range
- -lib/uri/rfc3986_parser.rb:rb/overly-large-range
- -lib/bundler/vendor/uri/lib/uri/mailto.rb:rb/overly-large-range
- -lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb:rb/overly-large-range
- -test/ruby/test_io.rb:rb/non-constant-kernel-open
- -test/open-uri/test_open-uri.rb:rb/non-constant-kernel-open
- -test/open-uri/test_ssl.rb:rb/non-constant-kernel-open
- -spec/ruby/core/io/binread_spec.rb:rb/non-constant-kernel-open
- -spec/ruby/core/io/readlines_spec.rb:rb/non-constant-kernel-open
- -spec/ruby/core/io/foreach_spec.rb:rb/non-constant-kernel-open
- -spec/ruby/core/io/write_spec.rb:rb/non-constant-kernel-open
- -spec/ruby/core/io/read_spec.rb:rb/non-constant-kernel-open
- -spec/ruby/core/kernel/open_spec.rb:rb/non-constant-kernel-open
- input: sarif-results/${{ matrix.language }}.sarif
- output: sarif-results/${{ matrix.language }}.sarif
- if: ${{ matrix.language == 'ruby' }}
-
- - name: Upload SARIF
- uses: github/codeql-action/upload-sarif@0225834cc549ee0ca93cb085b92954821a145866 # v2.3.5
- with:
- sarif_file: sarif-results/${{ matrix.language }}.sarif
+ - name: Checkout repository
+ uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+
+ - name: Install libraries
+ if: ${{ contains(matrix.os, 'macos') }}
+ uses: ./.github/actions/setup/macos
+
+ - name: Install libraries
+ if : ${{ matrix.os == 'ubuntu-latest' }}
+ uses: ./.github/actions/setup/ubuntu
+
+ - uses: ./.github/actions/setup/directories
+
+ - name: Remove an obsolete rubygems vendored file
+ if: ${{ matrix.os == 'ubuntu-latest' }}
+ run: sudo rm /usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb
+
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init@23acc5c183826b7a8a97bce3cecc52db901f8251 # v3.25.10
+ with:
+ languages: ${{ matrix.language }}
+
+ - name: Autobuild
+ uses: github/codeql-action/autobuild@23acc5c183826b7a8a97bce3cecc52db901f8251 # v3.25.10
+
+ - name: Perform CodeQL Analysis
+ uses: github/codeql-action/analyze@23acc5c183826b7a8a97bce3cecc52db901f8251 # v3.25.10
+ with:
+ category: '/language:${{ matrix.language }}'
+ upload: False
+ output: sarif-results
+
+ - name: filter-sarif
+ uses: advanced-security/filter-sarif@f3b8118a9349d88f7b1c0c488476411145b6270d # v1.0.1
+ with:
+ patterns: |
+ +**/*.rb
+ -lib/uri/mailto.rb:rb/overly-large-range
+ -lib/uri/rfc3986_parser.rb:rb/overly-large-range
+ -lib/bundler/vendor/uri/lib/uri/mailto.rb:rb/overly-large-range
+ -lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb:rb/overly-large-range
+ -test/ruby/test_io.rb:rb/non-constant-kernel-open
+ -test/open-uri/test_open-uri.rb:rb/non-constant-kernel-open
+ -test/open-uri/test_ssl.rb:rb/non-constant-kernel-open
+ -spec/ruby/core/io/binread_spec.rb:rb/non-constant-kernel-open
+ -spec/ruby/core/io/readlines_spec.rb:rb/non-constant-kernel-open
+ -spec/ruby/core/io/foreach_spec.rb:rb/non-constant-kernel-open
+ -spec/ruby/core/io/write_spec.rb:rb/non-constant-kernel-open
+ -spec/ruby/core/io/read_spec.rb:rb/non-constant-kernel-open
+ -spec/ruby/core/kernel/open_spec.rb:rb/non-constant-kernel-open
+ input: sarif-results/${{ matrix.language }}.sarif
+ output: sarif-results/${{ matrix.language }}.sarif
+ if: ${{ matrix.language == 'ruby' }}
+ continue-on-error: true
+
+ - name: Upload SARIF
+ uses: github/codeql-action/upload-sarif@23acc5c183826b7a8a97bce3cecc52db901f8251 # v3.25.10
+ with:
+ sarif_file: sarif-results/${{ matrix.language }}.sarif
+ continue-on-error: true
diff --git a/.github/workflows/compilers.yml b/.github/workflows/compilers.yml
index f7951a7237..9a3f2f2cd0 100644
--- a/.github/workflows/compilers.yml
+++ b/.github/workflows/compilers.yml
@@ -1,27 +1,24 @@
+# Some tests depending on this name 'Compilations' via $GITHUB_WORKFLOW. Make sure to update such tests when renaming this workflow.
name: Compilations
on:
push:
paths-ignore:
- 'doc/**'
- - '**/man'
+ - '**/man/*'
- '**.md'
- '**.rdoc'
- '**/.document'
+ - '.*.yml'
pull_request:
paths-ignore:
- 'doc/**'
- - '**/man'
+ - '**/man/*'
- '**.md'
- '**.rdoc'
- '**/.document'
+ - '.*.yml'
merge_group:
- paths-ignore:
- - 'doc/**'
- - '**/man'
- - '**.md'
- - '**.rdoc'
- - '**/.document'
concurrency:
group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }}
@@ -31,7 +28,7 @@ concurrency:
# environment variables (plus the "echo $GITHUB_ENV" hack) is to reroute that
# restriction.
env:
- default_cc: clang-16
+ default_cc: clang-18
append_cc: ''
# -O1 is faster than -O3 in our tests... Majority of time are consumed trying
@@ -53,7 +50,7 @@ env:
--without-gmp
CONFIGURE_TTY: never
- GITPULLOPTIONS: --no-tags origin ${{github.ref}}
+ GITPULLOPTIONS: --no-tags origin ${{ github.ref }}
RUBY_DEBUG: ci rgengc
RUBY_TESTOPTS: >-
-q
@@ -78,13 +75,15 @@ jobs:
- { name: gcc-9, env: { default_cc: gcc-9 } }
- { name: gcc-8, env: { default_cc: gcc-8 } }
- { name: gcc-7, env: { default_cc: gcc-7 } }
- - name: 'gcc-11 LTO'
- container: gcc-11
+ - name: 'gcc-13 LTO'
+ container: gcc-13
env:
- default_cc: 'gcc-11 -flto=auto -ffat-lto-objects'
+ default_cc: 'gcc-13 -flto=auto -ffat-lto-objects -Werror=lto-type-mismatch'
optflags: '-O2'
shared: disable
# check: true
+ - { name: clang-19, env: { default_cc: clang-19 } }
+ - { name: clang-18, env: { default_cc: clang-18 } }
- { name: clang-17, env: { default_cc: clang-17 } }
- { name: clang-16, env: { default_cc: clang-16 } }
- { name: clang-15, env: { default_cc: clang-15 } }
@@ -93,19 +92,20 @@ jobs:
- { name: clang-12, env: { default_cc: clang-12 } }
- { name: clang-11, env: { default_cc: clang-11 } }
- { name: clang-10, env: { default_cc: clang-10 } }
- - { name: clang-9, env: { default_cc: clang-9 } }
- - { name: clang-8, env: { default_cc: clang-8 } }
- - { name: clang-7, env: { default_cc: clang-7 } }
- - { name: clang-6.0, env: { default_cc: clang-6.0 } }
- - name: 'clang-14 LTO'
- container: clang-14
+ # llvm-objcopy<=9 doesn't have --wildcard. It compiles, but leaves Rust symbols in libyjit.o.
+ - { name: clang-9, env: { default_cc: clang-9, append_configure: '--disable-yjit' } }
+ - { name: clang-8, env: { default_cc: clang-8, append_configure: '--disable-yjit' } }
+ - { name: clang-7, env: { default_cc: clang-7, append_configure: '--disable-yjit' } }
+ - { name: clang-6.0, env: { default_cc: clang-6.0, append_configure: '--disable-yjit' } }
+ - name: 'clang-16 LTO'
+ container: clang-16
env:
- default_cc: 'clang-14 -flto=auto'
+ default_cc: 'clang-16 -flto=auto'
optflags: '-O2'
shared: disable
# check: true
- - { name: ext/Setup }
+ - { name: ext/Setup, static-exts: 'etc,json/*,*/escape' }
# - { name: aarch64-linux-gnu, crosshost: aarch64-linux-gnu, container: crossbuild-essential-arm64 }
# - { name: arm-linux-gnueabi, crosshost: arm-linux-gnueabi }
@@ -122,33 +122,35 @@ jobs:
# warning generates a lot of noise from use of ANYARGS in
# rb_define_method() and friends.
# See: https://github.com/llvm/llvm-project/commit/11da1b53d8cd3507959022cd790d5a7ad4573d94
- - { name: c99, env: { append_cc: '-std=c99 -Werror=pedantic -pedantic-errors -Wno-strict-prototypes' } }
-# - { name: c11, env: { append_cc: '-std=c11 -Werror=pedantic -pedantic-errors -Wno-strict-prototypes' } }
-# - { name: c17, env: { append_cc: '-std=c17 -Werror=pedantic -pedantic-errors -Wno-strict-prototypes' } }
- - { name: c2x, env: { append_cc: '-std=c2x -Werror=pedantic -pedantic-errors -Wno-strict-prototypes' } }
+ - { name: c99, env: { CFLAGS: '-std=c99 -Werror=pedantic -pedantic-errors -Wno-strict-prototypes' } }
+# - { name: c11, env: { CFLAGS: '-std=c11 -Werror=pedantic -pedantic-errors -Wno-strict-prototypes' } }
+# - { name: c17, env: { CFLAGS: '-std=c17 -Werror=pedantic -pedantic-errors -Wno-strict-prototypes' } }
+ - { name: c23, env: { CFLAGS: '-std=c2x -Werror=pedantic -pedantic-errors -Wno-strict-prototypes' } }
- { name: c++98, env: { CXXFLAGS: '-std=c++98 -Werror=pedantic -pedantic-errors -Wno-c++11-long-long' } }
# - { name: c++11, env: { CXXFLAGS: '-std=c++11 -Werror=pedantic -pedantic-errors -Wno-c++11-long-long' } }
# - { name: c++14, env: { CXXFLAGS: '-std=c++14 -Werror=pedantic -pedantic-errors -Wno-c++11-long-long' } }
# - { name: c++17, env: { CXXFLAGS: '-std=c++17 -Werror=pedantic -pedantic-errors -Wno-c++11-long-long' } }
- - { name: c++2a, env: { CXXFLAGS: '-std=c++2a -Werror=pedantic -pedantic-errors -Wno-c++11-long-long' } }
+# - { name: c++20, env: { CXXFLAGS: '-std=c++20 -Werror=pedantic -pedantic-errors -Wno-c++11-long-long' } }
+# - { name: c++23, env: { CXXFLAGS: '-std=c++23 -Werror=pedantic -pedantic-errors -Wno-c++11-long-long' } }
+ - { name: c++26, env: { CXXFLAGS: '-std=c++26 -Werror=pedantic -pedantic-errors -Wno-c++11-long-long' } }
- { name: '-O0', env: { optflags: '-O0 -march=x86-64 -mtune=generic' } }
# - { name: '-O3', env: { optflags: '-O3 -march=x86-64 -mtune=generic' }, check: true }
- - { name: gmp, env: { append_configure: '--with-gmp' } }
+ - { name: gmp, env: { append_configure: '--with-gmp' }, check: true }
- { name: jemalloc, env: { append_configure: '--with-jemalloc' } }
- { name: valgrind, env: { append_configure: '--with-valgrind' } }
- { name: 'coroutine=ucontext', env: { append_configure: '--with-coroutine=ucontext' } }
- { name: 'coroutine=pthread', env: { append_configure: '--with-coroutine=pthread' } }
- - { name: disable-jit-support, env: { append_configure: '--disable-jit-support' } }
+ - { name: disable-jit, env: { append_configure: '--disable-yjit --disable-rjit' } }
- { name: disable-dln, env: { append_configure: '--disable-dln' } }
- { name: enable-mkmf-verbose, env: { append_configure: '--enable-mkmf-verbose' } }
- { name: disable-rubygems, env: { append_configure: '--disable-rubygems' } }
- { name: RUBY_DEVEL, env: { append_configure: '--enable-devel' } }
+ - { name: OPT_THREADED_CODE=0, env: { cppflags: '-DOPT_THREADED_CODE=0' } }
- { name: OPT_THREADED_CODE=1, env: { cppflags: '-DOPT_THREADED_CODE=1' } }
- { name: OPT_THREADED_CODE=2, env: { cppflags: '-DOPT_THREADED_CODE=2' } }
- - { name: OPT_THREADED_CODE=3, env: { cppflags: '-DOPT_THREADED_CODE=3' } }
- { name: NDEBUG, env: { cppflags: '-DNDEBUG' } }
- { name: RUBY_DEBUG, env: { cppflags: '-DRUBY_DEBUG' } }
@@ -164,24 +166,27 @@ jobs:
# - { name: SYMBOL_DEBUG, env: { cppflags: '-DSYMBOL_DEBUG' } }
# - { name: RGENGC_CHECK_MODE, env: { cppflags: '-DRGENGC_CHECK_MODE' } }
-# - { name: TRANSIENT_HEAP_CHECK_MODE, env: { cppflags: '-DTRANSIENT_HEAP_CHECK_MODE' } }
# - { name: VM_CHECK_MODE, env: { cppflags: '-DVM_CHECK_MODE' } }
- - { name: USE_EMBED_CI=0, env: { cppflags: '-DUSE_EMBED_CI=0' } }
- - { name: USE_FLONUM=0, env: { cppflags: '-DUSE_FLONUM=0' } }
+# - { name: USE_EMBED_CI=0, env: { cppflags: '-DUSE_EMBED_CI=0' } }
+ - name: USE_FLONUM=0
+ env:
+ cppflags: '-DUSE_FLONUM=0'
+ # yjit requires FLONUM for the pointer tagging scheme
+ append_configure: '--disable-yjit'
# - { name: USE_GC_MALLOC_OBJ_INFO_DETAILS, env: { cppflags: '-DUSE_GC_MALLOC_OBJ_INFO_DETAILS' } }
- - { name: USE_LAZY_LOAD, env: { cppflags: '-DUSE_LAZY_LOAD' } }
+# - { name: USE_LAZY_LOAD, env: { cppflags: '-DUSE_LAZY_LOAD' } }
# - { name: USE_SYMBOL_GC=0, env: { cppflags: '-DUSE_SYMBOL_GC=0' } }
# - { name: USE_THREAD_CACHE=0, env: { cppflags: '-DUSE_THREAD_CACHE=0' } }
-# - { name: USE_TRANSIENT_HEAP=0, env: { cppflags: '-DUSE_TRANSIENT_HEAP=0' } }
- { name: USE_RUBY_DEBUG_LOG=1, env: { cppflags: '-DUSE_RUBY_DEBUG_LOG=1' } }
# - { name: USE_DEBUG_COUNTER, env: { cppflags: '-DUSE_DEBUG_COUNTER=1', RUBY_DEBUG_COUNTER_DISABLE: '1' } }
+ - { name: SHARABLE_MIDDLE_SUBSTRING, env: { cppflags: '-DSHARABLE_MIDDLE_SUBSTRING=1' } }
- - { name: DEBUG_FIND_TIME_NUMGUESS, env: { cppflags: '-DDEBUG_FIND_TIME_NUMGUESS' } }
- - { name: DEBUG_INTEGER_PACK, env: { cppflags: '-DDEBUG_INTEGER_PACK' } }
+# - { name: DEBUG_FIND_TIME_NUMGUESS, env: { cppflags: '-DDEBUG_FIND_TIME_NUMGUESS' } }
+# - { name: DEBUG_INTEGER_PACK, env: { cppflags: '-DDEBUG_INTEGER_PACK' } }
# - { name: ENABLE_PATH_CHECK, env: { cppflags: '-DENABLE_PATH_CHECK' } }
- - { name: GC_DEBUG_STRESS_TO_CLASS, env: { cppflags: '-DGC_DEBUG_STRESS_TO_CLASS' } }
+# - { name: GC_DEBUG_STRESS_TO_CLASS, env: { cppflags: '-DGC_DEBUG_STRESS_TO_CLASS' } }
# - { name: GC_ENABLE_LAZY_SWEEP=0, env: { cppflags: '-DGC_ENABLE_LAZY_SWEEP=0' } }
# - { name: GC_PROFILE_DETAIL_MEMOTY, env: { cppflags: '-DGC_PROFILE_DETAIL_MEMOTY' } }
# - { name: GC_PROFILE_MORE_DETAIL, env: { cppflags: '-DGC_PROFILE_MORE_DETAIL' } }
@@ -194,49 +199,53 @@ jobs:
# - { name: RGENGC_ESTIMATE_OLDMALLOC, env: { cppflags: '-DRGENGC_ESTIMATE_OLDMALLOC' } }
# - { name: RGENGC_FORCE_MAJOR_GC, env: { cppflags: '-DRGENGC_FORCE_MAJOR_GC' } }
# - { name: RGENGC_OBJ_INFO, env: { cppflags: '-DRGENGC_OBJ_INFO' } }
-# - { name: RGENGC_OLD_NEWOBJ_CHECK, env: { cppflags: '-DRGENGC_OLD_NEWOBJ_CHECK' } }
# - { name: RGENGC_PROFILE, env: { cppflags: '-DRGENGC_PROFILE' } }
# - { name: VM_DEBUG_BP_CHECK, env: { cppflags: '-DVM_DEBUG_BP_CHECK' } }
# - { name: VM_DEBUG_VERIFY_METHOD_CACHE, env: { cppflags: '-DVM_DEBUG_VERIFY_METHOD_CACHE' } }
- - { name: enable-yjit, env: { append_configure: '--enable-yjit --disable-rjit' }, rust: true }
+ - { name: enable-yjit, env: { append_configure: '--enable-yjit --disable-rjit' } }
- { name: enable-rjit, env: { append_configure: '--enable-rjit --disable-yjit' } }
- - { name: YJIT_FORCE_ENABLE, env: { cppflags: '-DYJIT_FORCE_ENABLE' }, rust: true }
+ - { name: YJIT_FORCE_ENABLE, env: { cppflags: '-DYJIT_FORCE_ENABLE' } }
# - { name: RJIT_FORCE_ENABLE, env: { cppflags: '-DRJIT_FORCE_ENABLE' } }
+ - { name: UNIVERSAL_PARSER, env: { cppflags: '-DUNIVERSAL_PARSER' } }
name: ${{ matrix.entry.name }}
+
runs-on: ubuntu-latest
+
container:
- image: ghcr.io/ruby/ruby-ci-image:${{ matrix.entry.container || matrix.entry.env.default_cc || 'clang-16' }}
+ image: ghcr.io/ruby/ruby-ci-image:${{ matrix.entry.container || matrix.entry.env.default_cc || 'clang-18' }}
options: --user root
- if: ${{ !contains(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }}
+
+ if: >-
+ ${{!(false
+ || contains(github.event.head_commit.message, '[DOC]')
+ || contains(github.event.head_commit.message, 'Document')
+ || contains(github.event.pull_request.title, '[DOC]')
+ || contains(github.event.pull_request.title, 'Document')
+ || contains(github.event.pull_request.labels.*.name, 'Document')
+ || (github.event_name == 'push' && github.actor == 'dependabot[bot]')
+ )}}
+
env: ${{ matrix.entry.env || matrix.env }}
+
steps:
- run: id
working-directory:
- - run: mkdir build
- working-directory:
- - name: setenv
- run: |
- echo "GNUMAKEFLAGS=-sj$((1 + $(nproc --all)))" >> $GITHUB_ENV
- - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
+
+ - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
- path: src
- - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
+ sparse-checkout-cone-mode: false
+ sparse-checkout: /.github
+
+ - uses: ./.github/actions/setup/directories
with:
- path: src/.downloaded-cache
- key: downloaded-cache
- - name: Install Rust
- if: ${{ matrix.entry.rust }}
- run: sudo apt-get update && sudo apt install -y rustc
- - name: autogen
- run: |
- if [ ! -f ./autogen.sh ]; then
- ls -la
- fi
- ./autogen.sh
- working-directory: src
+ srcdir: src
+ builddir: build
+ makeup: true
+ clean: true
+
- name: Run configure
run: >
../src/configure -C ${default_configure} ${append_configure}
@@ -246,40 +255,50 @@ jobs:
matrix.entry.crosshost || '"${default_cc}${append_cc:+ $append_cc}"'
}}
--${{ matrix.entry.shared || 'enable' }}-shared
- - name: Add to ext/Setup # statically link just the etc extension
- run: mkdir ext && echo etc >> ext/Setup
- if: ${{ matrix.entry.name == 'ext/Setup' }}
- - run: make extract-extlibs
- - run: make incs
+
+ - name: Add to ext/Setup
+ id: ext-setup
+ run: |
+ mkdir ext
+ cd ext
+ for ext in {${{ matrix.entry.static-exts }}}; do
+ echo "${ext}"
+ done >> Setup
+ if: ${{ (matrix.entry.static-exts || '') != '' }}
+
+ - name: Clean up ext/Setup
+ uses: gacts/run-and-post-run@4683764dd706df847f57b9bed39d08164bcd2690 # v1.4.1
+ with:
+ shell: bash
+ working-directory: build
+ post: rm ext/Setup
+ if: ${{ steps.ext-setup.outcome == 'success' }}
+
- run: make showflags
+
- run: make
+
- run: make test
+
- run: make install
if: ${{ matrix.entry.check }}
+
- run: make test-tool
if: ${{ matrix.entry.check }}
+
- run: make test-all TESTS='-- ruby -ext-'
if: ${{ matrix.entry.check }}
+
- run: make test-spec
env:
CHECK_LEAKS: true
if: ${{ matrix.entry.check }}
- - run: make test-annocheck
- if: ${{ matrix.entry.check && endsWith(matrix.entry.name, 'annocheck') }}
- - uses: ruby/action-slack@0bd85c72233cdbb6a0fe01d37aaeff1d21b5fce1 # v3.2.1
+ - uses: ./.github/actions/slack
with:
- payload: |
- {
- "ci": "GitHub Actions",
- "env": "${{ github.workflow }} / ${{ matrix.entry.name }}",
- "url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
- "commit": "${{ github.sha }}",
- "branch": "${{ github.ref_name }}"
- }
- env:
+ label: ${{ matrix.entry.name }}
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
- if: ${{ failure() && github.event_name == 'push' }}
+ if: ${{ failure() }}
defaults:
run:
diff --git a/.github/workflows/dependabot_automerge.yml b/.github/workflows/dependabot_automerge.yml
index 67fd0a9c5c..80112a0af3 100644
--- a/.github/workflows/dependabot_automerge.yml
+++ b/.github/workflows/dependabot_automerge.yml
@@ -6,21 +6,25 @@ on:
jobs:
automerge:
runs-on: ubuntu-latest
+
if: ${{ github.actor == 'dependabot[bot]' }}
+
steps:
- name: Dependabot metadata
- uses: dependabot/fetch-metadata@cd6e996708b8cfe0b639401134a3b9a3177be7b2 # v1.5.1
+ uses: dependabot/fetch-metadata@5e5f99653a5b510e8555840e80cbf1514ad4af38 # v2.1.0
id: metadata
+
- name: Wait for status checks
- uses: lewagon/wait-on-check-action@e106e5c43e8ca1edea6383a39a01c5ca495fd812 # v1.3.1
+ uses: lewagon/wait-on-check-action@ccfb013c15c8afb7bf2b7c028fb74dc5a068cccc # v1.3.4
with:
repo-token: ${{ secrets.MATZBOT_GITHUB_TOKEN }}
ref: ${{ github.event.pull_request.head.sha || github.sha }}
check-regexp: 'make \(check, .*\)'
wait-interval: 30
+
- name: Auto-merge for Dependabot PRs
- if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
+ if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch' }}
run: gh pr merge --auto --rebase "$PR_URL"
env:
- PR_URL: ${{github.event.pull_request.html_url}}
+ PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.MATZBOT_GITHUB_TOKEN }}
diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml
index 908a3f5b61..71e1b3c609 100644
--- a/.github/workflows/macos.yml
+++ b/.github/workflows/macos.yml
@@ -3,24 +3,15 @@ on:
push:
paths-ignore:
- 'doc/**'
- - '**/man'
+ - '**/man/*'
- '**.md'
- '**.rdoc'
- '**/.document'
+ - '.*.yml'
pull_request:
- paths-ignore:
- - 'doc/**'
- - '**/man'
- - '**.md'
- - '**.rdoc'
- - '**/.document'
+ # Do not use paths-ignore for required status checks
+ # 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
merge_group:
- paths-ignore:
- - 'doc/**'
- - '**/man'
- - '**.md'
- - '**.rdoc'
- - '**/.document'
concurrency:
group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }}
@@ -33,81 +24,140 @@ jobs:
make:
strategy:
matrix:
- test_task: ["check"] # "test-bundler-parallel", "test-bundled-gems"
- os:
- - macos-11
- - macos-12
+ include:
+ - test_task: check
+ - test_task: test-all
+ test_opts: --repeat-count=2
+ - test_task: test-bundler-parallel
+ - test_task: test-bundled-gems
+ - test_task: check
+ os: macos-12
+ - test_task: check
+ os: macos-13
fail-fast: false
+
env:
- GITPULLOPTIONS: --no-tags origin ${{github.ref}}
- runs-on: ${{ matrix.os }}
- if: ${{ !contains(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }}
+ GITPULLOPTIONS: --no-tags origin ${{ github.ref }}
+
+ runs-on: ${{ matrix.os || (github.repository == 'ruby/ruby' && 'macos-arm-oss' || 'macos-14')}}
+
+ if: >-
+ ${{!(false
+ || contains(github.event.head_commit.message, '[DOC]')
+ || contains(github.event.head_commit.message, 'Document')
+ || contains(github.event.pull_request.title, '[DOC]')
+ || contains(github.event.pull_request.title, 'Document')
+ || contains(github.event.pull_request.labels.*.name, 'Document')
+ || (github.event_name == 'push' && github.actor == 'dependabot[bot]')
+ )}}
+
steps:
- - run: mkdir build
- working-directory:
- - name: git config
- run: |
- git config --global advice.detachedHead 0
- git config --global init.defaultBranch garbage
- - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
+ - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
- path: src
- - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
- with:
- path: src/.downloaded-cache
- key: downloaded-cache
+ sparse-checkout-cone-mode: false
+ sparse-checkout: /.github
+
- name: Install libraries
+ uses: ./.github/actions/setup/macos
+
+ - uses: ./.github/actions/setup/directories
+ with:
+ srcdir: src
+ builddir: build
+ makeup: true
+ clean: true
+ dummy-files: ${{ matrix.test_task == 'check' }}
+ # Set fetch-depth: 0 so that Launchable can receive commits information.
+ fetch-depth: 10
+
+ - name: make sure that kern.coredump=1
run: |
- brew upgrade
- brew install gmp libffi openssl@1.1 zlib autoconf automake libtool readline
- working-directory: src
- - name: Set ENV
- run: |
- echo "MAKEFLAGS=-j$((1 + $(sysctl -n hw.activecpu)))" >> $GITHUB_ENV
- for lib in openssl@1.1 readline; do
- CONFIGURE_ARGS="${CONFIGURE_ARGS:+$CONFIGURE_ARGS }--with-${lib%@*}-dir=$(brew --prefix $lib)"
- done
- echo CONFIGURE_ARGS="${CONFIGURE_ARGS}" >> $GITHUB_ENV
- - run: ./autogen.sh
- working-directory: src
+ sysctl -n kern.coredump
+ sudo sysctl -w kern.coredump=1
+ sudo chmod -R +rwx /cores/
+
- name: Run configure
- run: ../src/configure -C --disable-install-doc
- - run: make incs
+ run: ../src/configure -C --disable-install-doc ${ruby_configure_args}
+
- run: make prepare-gems
if: ${{ matrix.test_task == 'test-bundled-gems' }}
+
- run: make
+
+ - name: Set test options for skipped tests
+ run: |
+ set -x
+ TESTS="$(echo "${{ matrix.skipped_tests }}" | sed 's| |$$/ -n!/|g;s|^|-n!/|;s|$|$$/|')"
+ echo "TESTS=${TESTS}" >> $GITHUB_ENV
+ if: ${{ matrix.test_task == 'check' && matrix.skipped_tests }}
+
+ - name: Set up Launchable
+ uses: ./.github/actions/launchable/setup
+ with:
+ os: ${{ matrix.os || (github.repository == 'ruby/ruby' && 'macos-arm-oss' || 'macos-14')}}
+ test-opts: ${{ matrix.test_opts }}
+ 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=3" >> $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: |
- make -s ${{ matrix.test_task }} ${TESTS:+TESTS=`echo "$TESTS" | sed 's| |$$/ -n!/|g;s|^|-n!/|;s|$|$$/|'`}
- timeout-minutes: 40
+ ulimit -c unlimited
+ make -s ${{ matrix.test_task }} ${TESTS:+TESTS="$TESTS"}
+ timeout-minutes: 60
env:
- RUBY_TESTOPTS: "-q --tty=no"
- TESTS: ${{ matrix.test_task == 'check' && matrix.skipped_tests || '' }}
- TEST_BUNDLED_GEMS_ALLOW_FAILURES: ""
- PRECHECK_BUNDLED_GEMS: "no"
+ RUBY_TESTOPTS: '-q --tty=no'
+ TEST_BUNDLED_GEMS_ALLOW_FAILURES: ''
+ PRECHECK_BUNDLED_GEMS: 'no'
+
- name: make skipped tests
run: |
- make -s test-all TESTS=`echo "$TESTS" | sed 's| |$$/ -n/|g;s|^|-n/|;s|$|$$/|'`
+ make -s test-all TESTS="${TESTS//-n!\//-n/}"
env:
- GNUMAKEFLAGS: ""
- RUBY_TESTOPTS: "-v --tty=no"
- TESTS: ${{ matrix.skipped_tests }}
- PRECHECK_BUNDLED_GEMS: "no"
- if: ${{ matrix.test_task == 'check' && matrix.skipped_tests != '' }}
+ 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: ruby/action-slack@0bd85c72233cdbb6a0fe01d37aaeff1d21b5fce1 # v3.2.1
+
+ - uses: ./.github/actions/slack
with:
- payload: |
- {
- "ci": "GitHub Actions",
- "env": "${{ matrix.os }} / ${{ matrix.test_task }}${{ matrix.configure }}",
- "url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
- "commit": "${{ github.sha }}",
- "branch": "${{ github.ref_name }}"
- }
- env:
+ label: ${{ matrix.os }} / ${{ matrix.test_task }}
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
- if: ${{ failure() && github.event_name == 'push' }}
+ 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
+ needs: [make]
+ steps:
+ - run: exit 1
+ working-directory:
+ if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
defaults:
run:
diff --git a/.github/workflows/mingw.yml b/.github/workflows/mingw.yml
index 158d962747..769097068b 100644
--- a/.github/workflows/mingw.yml
+++ b/.github/workflows/mingw.yml
@@ -3,24 +3,20 @@ on:
push:
paths-ignore:
- 'doc/**'
- - '**/man'
+ - '**/man/*'
- '**.md'
- '**.rdoc'
- '**/.document'
+ - '.*.yml'
pull_request:
paths-ignore:
- 'doc/**'
- - '**/man'
+ - '**/man/*'
- '**.md'
- '**.rdoc'
- '**/.document'
+ - '.*.yml'
merge_group:
- paths-ignore:
- - 'doc/**'
- - '**/man'
- - '**.md'
- - '**.rdoc'
- - '**/.document'
concurrency:
group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }}
@@ -35,49 +31,44 @@ permissions:
jobs:
make:
runs-on: windows-2022
+
name: ${{ github.workflow }} (${{ matrix.msystem }})
+
env:
MSYSTEM: ${{ matrix.msystem }}
MSYS2_ARCH: x86_64
- CHOST: "x86_64-w64-mingw32"
- CFLAGS: "-march=x86-64 -mtune=generic -O3 -pipe"
- CXXFLAGS: "-march=x86-64 -mtune=generic -O3 -pipe"
- CPPFLAGS: "-D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048"
- LDFLAGS: "-pipe"
- GITPULLOPTIONS: --no-tags origin ${{github.ref}}
+ CHOST: 'x86_64-w64-mingw32'
+ CFLAGS: '-march=x86-64 -mtune=generic -O3 -pipe'
+ CXXFLAGS: '-march=x86-64 -mtune=generic -O3 -pipe'
+ CPPFLAGS: '-D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048'
+ LDFLAGS: '-pipe'
+ GITPULLOPTIONS: --no-tags origin ${{ github.ref }}
+
strategy:
matrix:
include:
# To mitigate flakiness of MinGW CI, we test only one runtime that newer MSYS2 uses.
- - msystem: "UCRT64"
- base_ruby: head
- test_task: "check"
- test-all-opts: "--name=!/TestObjSpace#test_reachable_objects_during_iteration/"
+ - msystem: 'UCRT64'
+ baseruby: '3.0'
+ test_task: 'check'
+ test-all-opts: '--name=!/TestObjSpace#test_reachable_objects_during_iteration/'
fail-fast: false
- if: ${{ !contains(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }}
+
+ if: >-
+ ${{!(false
+ || contains(github.event.head_commit.message, '[DOC]')
+ || contains(github.event.head_commit.message, 'Document')
+ || contains(github.event.pull_request.title, '[DOC]')
+ || contains(github.event.pull_request.title, 'Document')
+ || contains(github.event.pull_request.labels.*.name, 'Document')
+ || (github.event_name == 'push' && github.actor == 'dependabot[bot]')
+ )}}
+
steps:
- - run: mkdir build
- working-directory:
- - name: git config
- run: |
- git config --global core.autocrlf false
- git config --global core.eol lf
- git config --global advice.detachedHead 0
- git config --global init.defaultBranch garbage
- - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- with:
- path: src
- - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
- with:
- path: src/.downloaded-cache
- key: downloaded-cache
- name: Set up Ruby & MSYS2
- uses: ruby/setup-ruby@8a45918450651f5e4784b6031db26f4b9f76b251 # v1.150.0
+ uses: ruby/setup-ruby@3783f195e29b74ae398d7caca108814bbafde90e # v1.180.1
with:
- ruby-version: ${{ matrix.base_ruby }}
- - name: set env
- run: |
- echo "GNUMAKEFLAGS=-j$((2 * NUMBER_OF_PROCESSORS))" >> $GITHUB_ENV
+ ruby-version: ${{ matrix.baseruby }}
- name: where check
run: |
@@ -86,11 +77,12 @@ jobs:
mv /c/Windows/System32/libssl-1_1-x64.dll /c/Windows/System32/libssl-1_1-x64.dll_
result=true
for e in gcc.exe ragel.exe make.exe libcrypto-1_1-x64.dll libssl-1_1-x64.dll; do
- echo '##['group']'$'\033[93m'$e$'\033[m'
+ echo ::group::$'\033[93m'$e$'\033[m'
where $e || result=false
- echo '##['endgroup']'
+ echo ::endgroup::
done
$result
+ working-directory:
- name: version check
run: |
@@ -98,80 +90,69 @@ jobs:
result=true
for e in gcc ragel make "openssl version"; do
case "$e" in *" "*) ;; *) e="$e --version";; esac
- echo '##['group']'$'\033[93m'$e$'\033[m'
+ echo ::group::$'\033[93m'$e$'\033[m'
$e || result=false
- echo '##['endgroup']'
+ echo ::endgroup::
done
$result
+ working-directory:
- - name: autogen
- run: |
- ./autogen.sh
- working-directory: src
+ - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ with:
+ sparse-checkout-cone-mode: false
+ sparse-checkout: /.github
+
+ - uses: ./.github/actions/setup/directories
+ with:
+ srcdir: src
+ builddir: build
+ makeup: true
- name: configure
run: >
../src/configure --disable-install-doc --prefix=/.
--build=$CHOST --host=$CHOST --target=$CHOST
- - name: update
- run: |
- make incs
-
- - name: download gems
- run: |
- make update-gems
-
- name: make all
timeout-minutes: 30
- run: |
- make
+ run: make
- name: make install
- run: |
- make DESTDIR=../install install-nodoc
+ run: make DESTDIR=../install install-nodoc
- name: test
timeout-minutes: 30
- run: |
- make test
+ run: make test
+ shell: cmd
env:
- GNUMAKEFLAGS: ""
- RUBY_TESTOPTS: "-v --tty=no"
- if: ${{matrix.test_task == 'check' || matrix.test_task == 'test'}}
+ GNUMAKEFLAGS: ''
+ RUBY_TESTOPTS: '-v --tty=no'
+ if: ${{ matrix.test_task == 'check' || matrix.test_task == 'test' }}
- name: test-all
timeout-minutes: 45
+ shell: cmd
run: |
- # Actions uses UTF8, causes test failures, similar to normal OS setup
- chcp.com 437
make ${{ StartsWith(matrix.test_task, 'test/') && matrix.test_task || 'test-all' }}
env:
RUBY_TESTOPTS: >-
--retry --job-status=normal --show-skip --timeout-scale=1.5
${{ matrix.test-all-opts }}
BUNDLER_VERSION:
- if: ${{matrix.test_task == 'check' || matrix.test_task == 'test-all' || StartsWith(matrix.test_task, 'test/')}}
+ if: ${{ matrix.test_task == 'check' || matrix.test_task == 'test-all' || StartsWith(matrix.test_task, 'test/') }}
- name: test-spec
timeout-minutes: 10
run: |
make ${{ StartsWith(matrix.test_task, 'spec/') && matrix.test_task || 'test-spec' }}
- if: ${{matrix.test_task == 'check' || matrix.test_task == 'test-spec' || StartsWith(matrix.test_task, 'spec/')}}
+ shell: cmd
+ if: ${{ matrix.test_task == 'check' || matrix.test_task == 'test-spec' || StartsWith(matrix.test_task, 'spec/') }}
- - uses: ruby/action-slack@0bd85c72233cdbb6a0fe01d37aaeff1d21b5fce1 # v3.2.1
+ - uses: ./src/.github/actions/slack
with:
- payload: |
- {
- "ci": "GitHub Actions",
- "env": "${{ github.workflow }} ${{ matrix.msystem }} / ${{ matrix.test_task }}",
- "url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
- "commit": "${{ github.sha }}",
- "branch": "${{ github.ref_name }}"
- }
- env:
+ label: ${{ matrix.msystem }} / ${{ matrix.test_task }}
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
- if: ${{ failure() && github.event_name == 'push' }}
+ if: ${{ failure() }}
defaults:
run:
diff --git a/.github/workflows/pr-playground.yml b/.github/workflows/pr-playground.yml
new file mode 100644
index 0000000000..cc06006142
--- /dev/null
+++ b/.github/workflows/pr-playground.yml
@@ -0,0 +1,127 @@
+name: Post Playground link to PR
+on:
+ pull_request_target:
+ types: [labeled]
+ workflow_run:
+ workflows: ["WebAssembly"]
+ types: [completed]
+
+jobs:
+ post-summary:
+ name: Post Playground link
+ runs-on: ubuntu-latest
+ permissions:
+ pull-requests: write
+ # Post a comment only if the PR status check is passed and the PR is labeled with `Playground`.
+ # Triggered twice: when the PR is labeled and when PR build is passed.
+ if: >-
+ ${{ false
+ || (true
+ && github.event_name == 'pull_request_target'
+ && contains(github.event.pull_request.labels.*.name, 'Playground'))
+ || (true
+ && github.event_name == 'workflow_run'
+ && github.event.workflow_run.conclusion == 'success'
+ && github.event.workflow_run.event == 'pull_request')
+ }}
+ steps:
+ - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
+ with:
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+ script: |
+ const fs = require('fs/promises');
+
+ const buildWorkflowPath = '.github/workflows/wasm.yml';
+ const findSuccessfuBuildRun = async (pr) => {
+ const opts = github.rest.actions.listWorkflowRunsForRepo.endpoint.merge({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ status: 'success',
+ branch: pr.head.ref,
+ });
+ const runs = await github.paginate(opts);
+ const buildRun = runs.find(run => run.path == buildWorkflowPath);
+ return buildRun;
+ }
+
+ const postComment = async (body, pr) => {
+ const { data: comments } = await github.rest.issues.listComments({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ issue_number: pr.number,
+ });
+
+ const commentOpts = { owner: context.repo.owner, repo: context.repo.repo, body: comment };
+
+ const existingComment = comments.find(comment => comment.body.startsWith(magicComment));
+ if (existingComment) {
+ core.info(`Updating existing comment: ${existingComment.html_url}`);
+ await github.rest.issues.updateComment({
+ ...commentOpts, comment_id: existingComment.id
+ });
+ } else {
+ await github.rest.issues.createComment({
+ ...commentOpts, issue_number: pr.number
+ });
+ }
+ }
+
+ const derivePRNumber = async () => {
+ if (context.payload.pull_request) {
+ return context.payload.pull_request.number;
+ }
+ // Workaround for https://github.com/orgs/community/discussions/25220
+
+ const { data: { artifacts } } = await github.rest.actions.listWorkflowRunArtifacts({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ run_id: context.payload.workflow_run.id,
+ });
+ const artifact = artifacts.find(artifact => artifact.name == 'github-pr-info');
+ if (!artifact) {
+ throw new Error('Cannot find github-pr-info.txt artifact');
+ }
+
+ const { data } = await github.rest.actions.downloadArtifact({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ artifact_id: artifact.id,
+ archive_format: 'zip',
+ });
+
+ await fs.writeFile('pr-info.zip', Buffer.from(data));
+ await exec.exec('unzip', ['pr-info.zip']);
+ return await fs.readFile('github-pr-info.txt', 'utf8');
+ }
+
+ const prNumber = await derivePRNumber();
+
+ const { data: pr } = await github.rest.pulls.get({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ pull_number: prNumber,
+ });
+
+ core.info(`Checking if the PR ${prNumber} is labeled with Playground...`);
+ if (!pr.labels.some(label => label.name == 'Playground')) {
+ core.info(`The PR is not labeled with Playground.`);
+ return;
+ }
+
+ core.info(`Checking if the build is successful for ${pr.head.ref} in ${pr.head.repo.owner.login}/${pr.head.repo.name}...`);
+ const buildRun = await findSuccessfuBuildRun(pr);
+ if (!buildRun) {
+ core.info(`No successful build run found for ${buildWorkflowPath} on ${pr.head.ref} yet.`);
+ return;
+ }
+ core.info(`Found a successful build run: ${buildRun.html_url}`);
+
+ const runLink = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`;
+ const magicComment = `<!-- AUTO-GENERATED-COMMENT-PR-PLAYGROUND -->`;
+ const comment = `${magicComment}
+ **Try on Playground**: https://ruby.github.io/play-ruby?run=${buildRun.id}
+ This is an automated comment by [\`pr-playground.yml\`](${runLink}) workflow.
+ `;
+ core.info(`Comment: ${comment}`);
+ await postComment(comment, pr);
+
diff --git a/.github/workflows/prism.yml b/.github/workflows/prism.yml
new file mode 100644
index 0000000000..e280a07b0b
--- /dev/null
+++ b/.github/workflows/prism.yml
@@ -0,0 +1,117 @@
+name: Prism
+on:
+ push:
+ paths-ignore:
+ - 'doc/**'
+ - '**.md'
+ - '**.rdoc'
+ - '**/.document'
+ - '**.[1-8]'
+ - '**.ronn'
+ - '.*.yml'
+ pull_request:
+ paths-ignore:
+ - 'doc/**'
+ - '**.md'
+ - '**.rdoc'
+ - '**/.document'
+ - '**.[1-8]'
+ - '**.ronn'
+ - '.*.yml'
+ merge_group:
+
+concurrency:
+ group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }}
+ cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }}
+
+permissions:
+ contents: read
+
+jobs:
+ make:
+ strategy:
+ matrix:
+ include:
+ - test_task: test
+ run_opts: '--parser=prism'
+ testopts: '-v --tty=no'
+ timeout: 30
+ - test_task: test-all
+ run_opts: '--parser=prism'
+ testopts: '-q --tty=no --excludes-dir="../src/test/.excludes-prism" --exclude="error_highlight/test_error_highlight.rb"'
+ timeout: 40
+ - test_task: test-spec
+ run_opts: '--parser=prism'
+ specopts: '-T --parser=prism'
+ timeout: 10
+ - test_task: test-tool
+ run_opts: '--parser=prism'
+ testopts: '-v --tty=no'
+ timeout: 30
+ - test_task: test-bundler-parallel
+ run_opts: '--parser=prism'
+ testopts: '-v --tty=no'
+ timeout: 30
+ - test_task: test-bundled-gems
+ run_opts: '--parser=prism'
+ testopts: '-v --tty=no'
+ timeout: 30
+ - test_task: test-syntax-suggest
+ run_opts: '--parser=prism'
+ testopts: '-v --tty=no'
+ timeout: 30
+ fail-fast: false
+
+ env:
+ GITPULLOPTIONS: --no-tags origin ${{ github.ref }}
+ RUBY_DEBUG: ci
+ SETARCH: ${{ matrix.arch && format('setarch {0}', matrix.arch) }}
+
+ runs-on: ubuntu-22.04
+
+ if: >-
+ ${{!(false
+ || contains(github.event.head_commit.message, '[DOC]')
+ || contains(github.event.head_commit.message, 'Document')
+ || contains(github.event.pull_request.title, '[DOC]')
+ || contains(github.event.pull_request.title, 'Document')
+ || contains(github.event.pull_request.labels.*.name, 'Document')
+ || (github.event_name == 'push' && github.actor == 'dependabot[bot]')
+ )}}
+
+ steps:
+ - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ with:
+ sparse-checkout-cone-mode: false
+ sparse-checkout: /.github
+
+ - uses: ./.github/actions/setup/ubuntu
+
+ - uses: ./.github/actions/setup/directories
+ with:
+ srcdir: src
+ builddir: build
+ makeup: true
+
+ - name: Run configure
+ run: ../src/configure -C --disable-install-doc cppflags=-DRUBY_DEBUG
+
+ - run: make
+
+ - name: make ${{ matrix.test_task }}
+ run: make -s ${{ matrix.test_task }} RUN_OPTS="$RUN_OPTS" SPECOPTS="$SPECOPTS"
+ timeout-minutes: ${{ matrix.timeout }}
+ env:
+ RUBY_TESTOPTS: ${{ matrix.testopts }}
+ RUN_OPTS: ${{ matrix.run_opts }}
+ SPECOPTS: ${{ matrix.specopts }}
+
+ - uses: ./.github/actions/slack
+ with:
+ label: ${{ matrix.run_opts }}
+ SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
+ if: ${{ failure() }}
+
+defaults:
+ run:
+ working-directory: build
diff --git a/.github/workflows/rjit-bindgen.yml b/.github/workflows/rjit-bindgen.yml
index a8cf5853d1..6d75d0176d 100644
--- a/.github/workflows/rjit-bindgen.yml
+++ b/.github/workflows/rjit-bindgen.yml
@@ -3,24 +3,20 @@ on:
push:
paths-ignore:
- 'doc/**'
- - '**/man'
+ - '**/man/*'
- '**.md'
- '**.rdoc'
- '**/.document'
+ - '.*.yml'
pull_request:
paths-ignore:
- 'doc/**'
- - '**/man'
+ - '**/man/*'
- '**.md'
- '**.rdoc'
- '**/.document'
+ - '.*.yml'
merge_group:
- paths-ignore:
- - 'doc/**'
- - '**/man'
- - '**.md'
- - '**.rdoc'
- - '**/.document'
concurrency:
group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }}
@@ -36,68 +32,54 @@ jobs:
include:
- task: rjit-bindgen
fail-fast: false
+
runs-on: ubuntu-20.04
- if: ${{ !contains(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }}
+
+ if: >-
+ ${{!(false
+ || contains(github.event.head_commit.message, '[DOC]')
+ || contains(github.event.head_commit.message, 'Document')
+ || contains(github.event.pull_request.title, '[DOC]')
+ || contains(github.event.pull_request.title, 'Document')
+ || contains(github.event.pull_request.labels.*.name, 'Document')
+ || (github.event_name == 'push' && github.actor == 'dependabot[bot]')
+ )}}
+
steps:
- - run: mkdir build
- working-directory:
- - name: Set ENV
- run: |
- echo "GNUMAKEFLAGS=-j$((1 + $(nproc --all)))" >> $GITHUB_ENV
- - 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 \
- libclang1-10 \
- autoconf
- sudo apt-get install -q -y pkg-config || :
- name: Set up Ruby
- uses: ruby/setup-ruby@8a45918450651f5e4784b6031db26f4b9f76b251 # v1.150.0
+ uses: ruby/setup-ruby@3783f195e29b74ae398d7caca108814bbafde90e # v1.180.1
with:
ruby-version: '3.1'
- - name: git config
- run: |
- git config --global advice.detachedHead 0
- git config --global init.defaultBranch garbage
- - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
+
+ - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
- path: src
- - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
+ sparse-checkout-cone-mode: false
+ sparse-checkout: /.github
+
+ - uses: ./.github/actions/setup/ubuntu
+
+ - uses: ./.github/actions/setup/directories
with:
- path: src/.downloaded-cache
- key: downloaded-cache
- - name: Fixed world writable dirs
- run: |
- chmod -v go-w $HOME $HOME/.config
- sudo chmod -R go-w /usr/share
- sudo bash -c 'IFS=:; for d in '"$PATH"'; do chmod -v go-w $d; done' || :
- - run: ./autogen.sh
- working-directory: src
+ srcdir: src
+ builddir: build
+ makeup: true
+
- name: Run configure
run: ../src/configure -C --disable-install-doc --prefix=$(pwd)/install --enable-yjit=dev_nodebug
- - run: make incs
+
- run: make
+
- run: make install
+
- run: make ${{ matrix.task }}
+
- run: git diff --exit-code
working-directory: src
- - uses: ruby/action-slack@0bd85c72233cdbb6a0fe01d37aaeff1d21b5fce1 # v3.2.1
+
+ - uses: ./.github/actions/slack
with:
- payload: |
- {
- "ci": "GitHub Actions",
- "env": "RJIT / bindgen",
- "url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
- "commit": "${{ github.sha }}",
- "branch": "${{ github.ref_name }}"
- }
- env:
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
- if: ${{ failure() && github.event_name == 'push' }}
+ if: ${{ failure() }}
defaults:
run:
diff --git a/.github/workflows/rjit.yml b/.github/workflows/rjit.yml
index f7dc9ad0ee..75c8152ce5 100644
--- a/.github/workflows/rjit.yml
+++ b/.github/workflows/rjit.yml
@@ -8,6 +8,7 @@ on:
- '**/.document'
- '**.[1-8]'
- '**.ronn'
+ - '.*.yml'
pull_request:
paths-ignore:
- 'doc/**'
@@ -16,14 +17,8 @@ on:
- '**/.document'
- '**.[1-8]'
- '**.ronn'
+ - '.*.yml'
merge_group:
- paths-ignore:
- - 'doc/**'
- - '**.md'
- - '**.rdoc'
- - '**/.document'
- - '**.[1-8]'
- - '**.ronn'
concurrency:
group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }}
@@ -41,93 +36,78 @@ jobs:
run_opts: ['--rjit-call-threshold=1']
arch: ['']
fail-fast: false
+
env:
- GITPULLOPTIONS: --no-tags origin ${{github.ref}}
+ GITPULLOPTIONS: --no-tags origin ${{ github.ref }}
RUBY_DEBUG: ci
SETARCH: ${{ matrix.arch && format('setarch {0}', matrix.arch) }}
+
runs-on: ubuntu-22.04
- if: ${{ !contains(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }}
+
+ if: >-
+ ${{!(false
+ || contains(github.event.head_commit.message, '[DOC]')
+ || contains(github.event.head_commit.message, 'Document')
+ || contains(github.event.pull_request.title, '[DOC]')
+ || contains(github.event.pull_request.title, 'Document')
+ || contains(github.event.pull_request.labels.*.name, 'Document')
+ || (github.event_name == 'push' && github.actor == 'dependabot[bot]')
+ )}}
+
steps:
- - run: mkdir build
- working-directory:
- - name: Set ENV
- run: |
- echo "GNUMAKEFLAGS=-j$((1 + $(nproc --all)))" >> $GITHUB_ENV
- - name: Install libraries
- env:
- arch: ${{matrix.arch}}
- run: |
- set -x
- arch=${arch:+:${arch/i[3-6]86/i386}}
- ${arch:+sudo dpkg --add-architecture ${arch#:}}
- sudo apt-get update -q || :
- sudo apt-get install --no-install-recommends -q -y \
- ${arch:+cross}build-essential${arch/:/-} \
- libssl-dev${arch} libyaml-dev${arch} libreadline6-dev${arch} \
- zlib1g-dev${arch} libncurses5-dev${arch} libffi-dev${arch} \
- autoconf ruby libcapstone-dev
- sudo apt-get install -q -y pkg-config${arch} || :
- - name: git config
- run: |
- git config --global advice.detachedHead 0
- git config --global init.defaultBranch garbage
- - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.1.0
+ - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
- path: src
- - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.0.11
+ sparse-checkout-cone-mode: false
+ sparse-checkout: /.github
+
+ - uses: ./.github/actions/setup/ubuntu
+
+ - uses: ./.github/actions/setup/directories
with:
- path: src/.downloaded-cache
- key: downloaded-cache
- - name: Fixed world writable dirs
- run: |
- chmod -v go-w $HOME $HOME/.config
- sudo chmod -R go-w /usr/share
- sudo bash -c 'IFS=:; for d in '"$PATH"'; do chmod -v go-w $d; done' || :
- - run: ./autogen.sh
- working-directory: src
+ srcdir: src
+ builddir: build
+ makeup: true
+
- name: Run configure
env:
- arch: ${{matrix.arch}}
+ arch: ${{ matrix.arch }}
run: >-
$SETARCH ../src/configure -C --disable-install-doc cppflags=-DRUBY_DEBUG
${arch:+--target=$arch-$OSTYPE --host=$arch-$OSTYPE}
+
- run: $SETARCH make
+
- name: make test
run: |
$SETARCH make -s test RUN_OPTS="$RUN_OPTS"
timeout-minutes: 30
env:
- GNUMAKEFLAGS: ""
- RUBY_TESTOPTS: "-v --tty=no"
+ GNUMAKEFLAGS: ''
+ RUBY_TESTOPTS: '--tty=no'
RUN_OPTS: ${{ matrix.run_opts }}
+
- name: make test-all
run: |
$SETARCH make -s test-all RUN_OPTS="$RUN_OPTS"
timeout-minutes: 40
env:
- GNUMAKEFLAGS: ""
- RUBY_TESTOPTS: "-v --tty=no"
+ GNUMAKEFLAGS: ''
+ RUBY_TESTOPTS: '-q --tty=no'
RUN_OPTS: ${{ matrix.run_opts }}
+
- name: make test-spec
run: |
$SETARCH make -s test-spec RUN_OPTS="$RUN_OPTS"
timeout-minutes: 10
env:
- GNUMAKEFLAGS: ""
+ GNUMAKEFLAGS: ''
RUN_OPTS: ${{ matrix.run_opts }}
- - uses: ruby/action-slack@0bd85c72233cdbb6a0fe01d37aaeff1d21b5fce1 # v3.2.1
+
+ - uses: ./.github/actions/slack
with:
- payload: |
- {
- "ci": "GitHub Actions",
- "env": "RJIT / ${{ matrix.run_opts }}",
- "url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
- "commit": "${{ github.sha }}",
- "branch": "${{ github.ref_name }}"
- }
- env:
+ label: ${{ matrix.run_opts }}
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
- if: ${{ failure() && github.event_name == 'push' }}
+ if: ${{ failure() }}
defaults:
run:
diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml
index df87330a58..61b02615c8 100644
--- a/.github/workflows/scorecards.yml
+++ b/.github/workflows/scorecards.yml
@@ -31,13 +31,13 @@ jobs:
# actions: read
steps:
- - name: "Checkout code"
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
+ - name: 'Checkout code'
+ uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
persist-credentials: false
- - name: "Run analysis"
- uses: ossf/scorecard-action@80e868c13c90f172d68d1f4501dee99e2479f7af # v2.1.3
+ - name: 'Run analysis'
+ uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534 # v2.3.3
with:
results_file: results.sarif
results_format: sarif
@@ -66,7 +66,7 @@ jobs:
# retention-days: 5
# Upload the results to GitHub's code scanning dashboard.
- - name: "Upload to code-scanning"
- uses: github/codeql-action/upload-sarif@0225834cc549ee0ca93cb085b92954821a145866 # v2.1.27
+ - name: 'Upload to code-scanning'
+ uses: github/codeql-action/upload-sarif@23acc5c183826b7a8a97bce3cecc52db901f8251 # v2.1.27
with:
sarif_file: results.sarif
diff --git a/.github/workflows/spec_guards.yml b/.github/workflows/spec_guards.yml
index bf784021e0..51c46728e7 100644
--- a/.github/workflows/spec_guards.yml
+++ b/.github/workflows/spec_guards.yml
@@ -6,13 +6,10 @@ on:
- 'spec/**'
- '!spec/*.md'
pull_request:
- paths-ignore:
+ paths:
- 'spec/**'
- '!spec/*.md'
merge_group:
- paths-ignore:
- - 'spec/**'
- - '!spec/*.md'
concurrency:
group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }}
@@ -24,8 +21,19 @@ permissions:
jobs:
rubyspec:
name: Rubyspec
+
runs-on: ubuntu-20.04
- if: ${{ !contains(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }}
+
+ if: >-
+ ${{!(false
+ || contains(github.event.head_commit.message, '[DOC]')
+ || contains(github.event.head_commit.message, 'Document')
+ || contains(github.event.pull_request.title, '[DOC]')
+ || contains(github.event.pull_request.title, 'Document')
+ || contains(github.event.pull_request.labels.*.name, 'Document')
+ || (github.event_name == 'push' && github.actor == 'dependabot[bot]')
+ )}}
+
strategy:
matrix:
# Specs from ruby/spec should still run on all supported Ruby versions.
@@ -34,28 +42,25 @@ jobs:
- ruby-3.0
- ruby-3.1
- ruby-3.2
+ - ruby-3.3
steps:
- - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- - uses: ruby/setup-ruby@8a45918450651f5e4784b6031db26f4b9f76b251 # v1.150.0
+ - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+
+ - uses: ruby/setup-ruby@3783f195e29b74ae398d7caca108814bbafde90e # v1.180.1
with:
ruby-version: ${{ matrix.ruby }}
bundler: none
+
- run: gem install webrick
+
- run: ruby ../mspec/bin/mspec
working-directory: spec/ruby
env:
CHECK_LEAKS: true
- - uses: ruby/action-slack@0bd85c72233cdbb6a0fe01d37aaeff1d21b5fce1 # v3.2.1
+
+ - uses: ./.github/actions/slack
with:
- payload: |
- {
- "ci": "GitHub Actions",
- "env": "${{ github.workflow }} / rubyspec @ ${{ matrix.ruby }}",
- "url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
- "commit": "${{ github.sha }}",
- "branch": "${{ github.ref_name }}"
- }
- env:
+ label: ${{ matrix.ruby }}
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
- if: ${{ failure() && github.event_name == 'push' }}
+ if: ${{ failure() }}
diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml
index d8a557ab4f..130393f2cf 100644
--- a/.github/workflows/ubuntu.yml
+++ b/.github/workflows/ubuntu.yml
@@ -3,24 +3,15 @@ on:
push:
paths-ignore:
- 'doc/**'
- - '**/man'
+ - '**/man/*'
- '**.md'
- '**.rdoc'
- '**/.document'
+ - '.*.yml'
pull_request:
- paths-ignore:
- - 'doc/**'
- - '**/man'
- - '**.md'
- - '**.rdoc'
- - '**/.document'
+ # Do not use paths-ignore for required status checks
+ # 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
merge_group:
- paths-ignore:
- - 'doc/**'
- - '**/man'
- - '**.md'
- - '**.rdoc'
- - '**/.document'
concurrency:
group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }}
@@ -33,111 +24,129 @@ jobs:
make:
strategy:
matrix:
- test_task: [check]
- arch: ['']
- configure: ['cppflags=-DVM_CHECK_MODE']
- # specifying everything else with `include` to avoid redundant tests
include:
- test_task: check
+ configure: 'cppflags=-DVM_CHECK_MODE'
+ - test_task: check
arch: i686
- test_task: check
+ configure: '--disable-yjit'
+ - test_task: check
configure: '--enable-shared --enable-load-relative'
- - test_task: test-all TESTS=--repeat-count=2
+ - test_task: check
+ configure: '--with-shared-gc'
- test_task: test-bundler-parallel
- test_task: test-bundled-gems
+ - test_task: check
+ os: ubuntu-20.04
fail-fast: false
+
env:
- GITPULLOPTIONS: --no-tags origin ${{github.ref}}
+ GITPULLOPTIONS: --no-tags origin ${{ github.ref }}
RUBY_DEBUG: ci
- SETARCH: ${{ matrix.arch && format('setarch {0}', matrix.arch) }}
- runs-on: ubuntu-20.04
- if: ${{ !contains(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }}
+
+ runs-on: ${{ matrix.os || 'ubuntu-22.04' }}
+
+ if: >-
+ ${{!(false
+ || contains(github.event.head_commit.message, '[DOC]')
+ || contains(github.event.head_commit.message, 'Document')
+ || contains(github.event.pull_request.title, '[DOC]')
+ || contains(github.event.pull_request.title, 'Document')
+ || contains(github.event.pull_request.labels.*.name, 'Document')
+ || (github.event_name == 'push' && github.actor == 'dependabot[bot]')
+ )}}
+
steps:
- - run: mkdir build
- working-directory:
- - name: Set ENV
- run: |
- echo "GNUMAKEFLAGS=-j$((1 + $(nproc --all)))" >> $GITHUB_ENV
- - name: Install libraries
- env:
- arch: ${{matrix.arch}}
- run: |
- set -x
- arch=${arch:+:${arch/i[3-6]86/i386}}
- ${arch:+sudo dpkg --add-architecture ${arch#:}}
- sudo apt-get update -q || :
- sudo apt-get install --no-install-recommends -q -y \
- ${arch:+cross}build-essential${arch/:/-} \
- libssl-dev${arch} libyaml-dev${arch} libreadline6-dev${arch} \
- zlib1g-dev${arch} libncurses5-dev${arch} libffi-dev${arch} \
- autoconf ruby
- sudo apt-get install -q -y pkg-config${arch} || :
- - name: git config
- run: |
- git config --global advice.detachedHead 0
- git config --global init.defaultBranch garbage
- - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
+ - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ with:
+ sparse-checkout-cone-mode: false
+ sparse-checkout: /.github
+
+ - uses: ./.github/actions/setup/ubuntu
with:
- path: src
- - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
+ arch: ${{ matrix.arch }}
+
+ - uses: ruby/setup-ruby@3783f195e29b74ae398d7caca108814bbafde90e # v1.180.1
with:
- path: src/.downloaded-cache
- key: downloaded-cache
- - name: Fixed world writable dirs
- run: |
- chmod -v go-w $HOME $HOME/.config
- sudo chmod -R go-w /usr/share
- sudo bash -c 'IFS=:; for d in '"$PATH"'; do chmod -v go-w $d; done' || :
- - run: ./autogen.sh
- working-directory: src
+ ruby-version: '3.0'
+ bundler: none
+
+ - uses: ./.github/actions/setup/directories
+ with:
+ srcdir: src
+ builddir: build
+ makeup: true
+ clean: true
+ dummy-files: ${{ matrix.test_task == 'check' }}
+ # Set fetch-depth: 10 so that Launchable can receive commits information.
+ fetch-depth: 10
+
- name: Run configure
env:
- arch: ${{matrix.arch}}
- configure: ${{matrix.configure}}
+ 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 incs
+
- run: $SETARCH make prepare-gems
if: ${{ matrix.test_task == 'test-bundled-gems' }}
+
- run: $SETARCH make
- - name: Create dummy files in build dir
+
+ - name: Set test options for skipped tests
run: |
- $SETARCH ./miniruby -e '(("a".."z").to_a+("A".."Z").to_a+("0".."9").to_a+%w[foo bar test zzz]).each{|basename|File.write("#{basename}.rb", "raise %(do not load #{basename}.rb)")}'
- if: ${{ matrix.test_task == 'check' }}
+ set -x
+ TESTS="$(echo "${{ matrix.skipped_tests }}" | sed 's| |$$/ -n!/|g;s|^|-n!/|;s|$|$$/|')"
+ echo "TESTS=${TESTS}" >> $GITHUB_ENV
+ if: ${{ matrix.test_task == 'check' && matrix.skipped_tests }}
+
+ - name: Set up Launchable
+ uses: ./.github/actions/launchable/setup
+ with:
+ os: ${{ matrix.os || 'ubuntu-22.04' }}
+ test-opts: ${{ matrix.configure }}
+ launchable-token: ${{ secrets.LAUNCHABLE_TOKEN }}
+ builddir: build
+ srcdir: src
+ continue-on-error: true
+
- name: make ${{ matrix.test_task }}
run: >-
$SETARCH make -s ${{ matrix.test_task }}
- ${TESTS:+TESTS=`echo "$TESTS" | sed 's| |$$/ -n!/|g;s|^|-n!/|;s|$|$$/|'`}
- ${{ contains(matrix.test_task, 'bundle') && '' || 'RUBYOPT=-w' }}
+ ${TESTS:+TESTS="$TESTS"}
+ ${{ !contains(matrix.test_task, 'bundle') && 'RUBYOPT=-w' || '' }}
timeout-minutes: 40
env:
- RUBY_TESTOPTS: "-q --tty=no"
- TESTS: ${{ matrix.test_task == 'check' && matrix.skipped_tests || '' }}
- TEST_BUNDLED_GEMS_ALLOW_FAILURES: ""
- PRECHECK_BUNDLED_GEMS: "no"
+ RUBY_TESTOPTS: '-q --tty=no'
+ TEST_BUNDLED_GEMS_ALLOW_FAILURES: ''
+ PRECHECK_BUNDLED_GEMS: 'no'
+
- name: make skipped tests
run: |
- $SETARCH make -s test-all TESTS=`echo "$TESTS" | sed 's| |$$/ -n/|g;s|^|-n/|;s|$|$$/|'`
+ $SETARCH make -s test-all TESTS="${TESTS//-n!\//-n/}"
env:
- GNUMAKEFLAGS: ""
- RUBY_TESTOPTS: "-v --tty=no"
- TESTS: ${{ matrix.skipped_tests }}
- if: ${{ matrix.test_task == 'check' && matrix.skipped_tests != '' }}
+ GNUMAKEFLAGS: ''
+ RUBY_TESTOPTS: '-v --tty=no'
+ if: ${{ matrix.test_task == 'check' && matrix.skipped_tests }}
continue-on-error: ${{ matrix.continue-on-skipped_tests || false }}
- - uses: ruby/action-slack@0bd85c72233cdbb6a0fe01d37aaeff1d21b5fce1 # v3.2.1
+
+ - uses: ./.github/actions/slack
with:
- payload: |
- {
- "ci": "GitHub Actions",
- "env": "${{ github.workflow }} / ${{ matrix.test_task }} ${{ matrix.configure }}${{ matrix.arch }}",
- "url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
- "commit": "${{ github.sha }}",
- "branch": "${{ github.ref_name }}"
- }
- env:
+ label: ${{ matrix.test_task }} ${{ matrix.configure }}${{ matrix.arch }}
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
- if: ${{ failure() && github.event_name == 'push' }}
+ if: ${{ failure() }}
+
+ result:
+ if: ${{ always() }}
+ name: ${{ github.workflow }} result
+ runs-on: ubuntu-latest
+ needs: [make]
+ steps:
+ - run: exit 1
+ working-directory:
+ if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
defaults:
run:
diff --git a/.github/workflows/wasm.yml b/.github/workflows/wasm.yml
index 9e123889d6..a0a71be76d 100644
--- a/.github/workflows/wasm.yml
+++ b/.github/workflows/wasm.yml
@@ -3,30 +3,26 @@ on:
push:
paths-ignore:
- 'doc/**'
- - '**/man'
+ - '**/man/*'
- '**.md'
- '**.rdoc'
- '**/.document'
+ - '.*.yml'
pull_request:
paths-ignore:
- 'doc/**'
- - '**/man'
+ - '**/man/*'
- '**.md'
- '**.rdoc'
- '**/.document'
+ - '.*.yml'
merge_group:
- paths-ignore:
- - 'doc/**'
- - '**/man'
- - '**.md'
- - '**.rdoc'
- - '**/.document'
concurrency:
group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }}
cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }}
-permissions: # added using https://github.com/step-security/secure-workflows
+permissions: # added using https://github.com/step-security/secure-workflows
contents: read
jobs:
@@ -35,33 +31,47 @@ jobs:
matrix:
entry:
# # wasmtime can't compile non-optimized Asyncified binary due to locals explosion
-# - { name: O0-debuginfo, optflags: "-O0", debugflags: "-g", wasmoptflags: "-O1" }
-# - { name: O1, optflags: "-O1", debugflags: "" , wasmoptflags: "-O1" }
- - { name: O2, optflags: "-O2", debugflags: "" , wasmoptflags: "-O2" }
-# - { name: O3, optflags: "-O3", debugflags: "" , wasmoptflags: "-O3" }
+# - { name: O0-debuginfo, optflags: '-O0', debugflags: '-g', wasmoptflags: '-O1' }
+# - { name: O1, optflags: '-O1', debugflags: '' , wasmoptflags: '-O1' }
+ - { name: O2, optflags: '-O2', debugflags: '', wasmoptflags: '-O2' }
+# - { name: O3, optflags: '-O3', debugflags: '' , wasmoptflags: '-O3' }
# # -O4 is equivalent to -O3 in clang, but it's different in wasm-opt
-# - { name: O4, optflags: "-O3", debugflags: "" , wasmoptflags: "-O4" }
-# - { name: Oz, optflags: "-Oz", debugflags: "" , wasmoptflags: "-Oz" }
+# - { name: O4, optflags: '-O3', debugflags: '' , wasmoptflags: '-O4' }
+# - { name: Oz, optflags: '-Oz', debugflags: '' , wasmoptflags: '-Oz' }
fail-fast: false
+
env:
RUBY_TESTOPTS: '-q --tty=no'
- GITPULLOPTIONS: --no-tags origin ${{github.ref}}
- WASI_SDK_VERSION_MAJOR: 14
+ GITPULLOPTIONS: --no-tags origin ${{ github.ref }}
+ WASI_SDK_VERSION_MAJOR: 20
WASI_SDK_VERSION_MINOR: 0
- BINARYEN_VERSION: 109
- WASMTIME_VERSION: v0.33.0
+ BINARYEN_VERSION: 113
+ WASMTIME_VERSION: v15.0.0
+
runs-on: ubuntu-20.04
- if: ${{ !contains(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }}
+
+ if: >-
+ ${{!(false
+ || contains(github.event.head_commit.message, '[DOC]')
+ || contains(github.event.head_commit.message, 'Document')
+ || contains(github.event.pull_request.title, '[DOC]')
+ || contains(github.event.pull_request.title, 'Document')
+ || contains(github.event.pull_request.labels.*.name, 'Document')
+ || (github.event_name == 'push' && github.actor == 'dependabot[bot]')
+ )}}
+
steps:
- - run: mkdir build
- working-directory:
- - name: git config
- run: |
- git config --global advice.detachedHead 0
- git config --global init.defaultBranch garbage
- - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
+ - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ with:
+ sparse-checkout-cone-mode: false
+ sparse-checkout: /.github
+
+ - uses: ./.github/actions/setup/directories
with:
- path: src
+ srcdir: src
+ builddir: build
+ makeup: true
+
- name: Install libraries
run: |
set -ex
@@ -85,17 +95,32 @@ jobs:
wget -O - "$binaryen_url" | tar xfz -
sudo ln -fs "$PWD/binaryen-version_${BINARYEN_VERSION}/bin/wasm-opt" /usr/local/bin/wasm-opt
working-directory: src
+
- name: Set ENV
run: |
- echo "MAKEFLAGS=-j$((1 + $(sysctl -n hw.activecpu)))" >> $GITHUB_ENV
echo "WASI_SDK_PATH=/opt/wasi-sdk" >> $GITHUB_ENV
- - run: ./autogen.sh
- working-directory: src
+
+ - uses: ruby/setup-ruby@3783f195e29b74ae398d7caca108814bbafde90e # v1.180.1
+ with:
+ ruby-version: '3.0'
+ bundler: none
+
+ - name: Build baseruby
+ run: |
+ set -ex
+ mkdir ../baseruby
+ pushd ../baseruby
+ ../src/configure --prefix=$PWD/install
+ make
+ make install
+
- name: Run configure
run: |
../src/configure \
--host wasm32-unknown-wasi \
+ --with-baseruby=$PWD/../baseruby/install/bin/ruby \
--with-static-linked-ext \
+ --with-ext=cgi/escape,continuation,coverage,date,digest/bubblebabble,digest,digest/md5,digest/rmd160,digest/sha1,digest/sha2,etc,fcntl,json,json/generator,json/parser,objspace,pathname,rbconfig/sizeof,ripper,stringio,strscan,monitor \
LDFLAGS=" \
-Xlinker --stack-first \
-Xlinker -z -Xlinker stack-size=16777216 \
@@ -106,28 +131,44 @@ jobs:
# miniruby may not be built when cross-compling
- run: make mini ruby
+
+ - run: make install DESTDIR=$PWD/../install
+ - run: tar cfz ../install.tar.gz -C ../install .
+
+ - name: Upload artifacts
+ uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
+ with:
+ name: ruby-wasm-install
+ path: ${{ github.workspace }}/install.tar.gz
+ - name: Show Playground URL to try the build
+ run: |
+ echo "Try on Playground: https://ruby.github.io/play-ruby?run=$GITHUB_RUN_ID" >> $GITHUB_STEP_SUMMARY
+
- name: Run basictest
run: wasmtime run ./../build/miniruby --mapdir /::./ -- basictest/test.rb
working-directory: src
+
- name: Run bootstraptest (no thread)
run: |
NO_THREAD_TESTS="$(grep -L Thread -R ./bootstraptest | awk -F/ '{ print $NF }' | uniq | sed -n 's/test_\(.*\).rb/\1/p' | paste -s -d, -)"
ruby ./bootstraptest/runner.rb --ruby="$(which wasmtime) run $PWD/../build/ruby --mapdir /::./ -- " --verbose "--sets=$NO_THREAD_TESTS"
working-directory: src
- - uses: ruby/action-slack@0bd85c72233cdbb6a0fe01d37aaeff1d21b5fce1 # v3.2.1
+ - uses: ./.github/actions/slack
with:
- payload: |
- {
- "ci": "GitHub Actions",
- "env": "${{ github.workflow }} / ${{ matrix.name }}",
- "url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
- "commit": "${{ github.sha }}",
- "branch": "${{ github.ref_name }}"
- }
- env:
+ label: ${{ matrix.entry.name }}
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
- if: ${{ failure() && github.event_name == 'push' }}
+ if: ${{ failure() }}
+
+ # Workaround for https://github.com/orgs/community/discussions/25220
+ - name: Save Pull Request number
+ if: ${{ github.event_name == 'pull_request' }}
+ run: echo "${{ github.event.pull_request.number }}" >> ${{ github.workspace }}/github-pr-info.txt
+ - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
+ if: ${{ github.event_name == 'pull_request' }}
+ with:
+ name: github-pr-info
+ path: ${{ github.workspace }}/github-pr-info.txt
defaults:
run:
diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml
index 79564e5834..2ed3601cce 100644
--- a/.github/workflows/windows.yml
+++ b/.github/workflows/windows.yml
@@ -3,24 +3,20 @@ on:
push:
paths-ignore:
- 'doc/**'
- - '**/man'
+ - '**/man/*'
- '**.md'
- '**.rdoc'
- '**/.document'
+ - '.*.yml'
pull_request:
paths-ignore:
- 'doc/**'
- - '**/man'
+ - '**/man/*'
- '**.md'
- '**.rdoc'
- '**/.document'
+ - '.*.yml'
merge_group:
- paths-ignore:
- - 'doc/**'
- - '**/man'
- - '**.md'
- - '**.rdoc'
- - '**/.document'
concurrency:
group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }}
@@ -34,121 +30,172 @@ jobs:
strategy:
matrix:
include:
+ - vc: 2015
+ vs: 2019
+ vcvars: '10.0.14393.0 -vcvars_ver=14.0' # The oldest Windows 10 SDK w/ VC++ 2015 toolset (v140)
- vs: 2019
- vs: 2022
fail-fast: false
+
runs-on: windows-${{ matrix.vs < 2022 && '2019' || matrix.vs }}
- if: ${{ !contains(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }}
- name: VisualStudio ${{ matrix.vs }}
+
+ if: >-
+ ${{!(false
+ || contains(github.event.head_commit.message, '[DOC]')
+ || contains(github.event.head_commit.message, 'Document')
+ || contains(github.event.pull_request.title, '[DOC]')
+ || contains(github.event.pull_request.title, 'Document')
+ || contains(github.event.pull_request.labels.*.name, 'Document')
+ || (github.event_name == 'push' && github.actor == 'dependabot[bot]')
+ )}}
+
+ name: VisualStudio ${{ matrix.vc || matrix.vs }}
+
env:
- GITPULLOPTIONS: --no-tags origin ${{github.ref}}
- PATCH: C:\msys64\usr\bin\patch.exe
+ GITPULLOPTIONS: --no-tags origin ${{ github.ref }}
OS_VER: windows-${{ matrix.vs < 2022 && '2019' || matrix.vs }}
+ # FIXME: This is a workaround for the vcpkg's issue present as of openssl 3.1.1
+ # where OpenSSL's default modules directory is incorrectly set to C:\vcpkg\packages\openssl_x64-windows\bin
+ # cf. https://github.com/ruby/openssl/pull/635#issuecomment-1596833720
+ OPENSSL_MODULES: C:\vcpkg\installed\x64-windows\bin
+
steps:
- run: md build
working-directory:
+
+ - name: find tools
+ id: find-tools
+ run: |
+ ::- find needed tools
+ set NEEDS=
+ for %%I in (%NEEDED_TOOLS%) do if "%%~$PATH:I" == "" (
+ call set NEEDS=%%NEEDS%% %%~nI
+ ) else (
+ echo %%I: %%~$PATH:I
+ )
+ echo.needs=%NEEDS%>>%GITHUB_OUTPUT%
+ if "%NEEDS%" == "" (
+ echo [debug] All needed tools found
+ ) else (
+ echo [warning^]Needs%NEEDS%
+ )
+ env:
+ NEEDED_TOOLS: >-
+ patch.exe
+
- uses: msys2/setup-msys2@d40200dc2db4c351366b048a9565ad82919e1c24 # v2
id: setup-msys2
with:
update: true
install: >-
- patch
- if: ${{ env.OS_VER != 'windows-2019' }}
- - name: patch path
- shell: msys2 {0}
- run: echo PATCH=$(cygpath -wa $(command -v patch)) >> $GITHUB_ENV
- if: ${{ steps.setup-msys2.outcome == 'success' }}
- - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
+ ${{ steps.find-tools.outputs.needs }}
+ if: ${{ steps.find-tools.outputs.needs != '' }}
+
+ - uses: ruby/setup-ruby@3783f195e29b74ae398d7caca108814bbafde90e # v1.180.1
with:
- path: C:\vcpkg\downloads
- key: ${{ runner.os }}-vcpkg-download-${{ env.OS_VER }}-${{ github.sha }}
- restore-keys: |
- ${{ runner.os }}-vcpkg-download-${{ env.OS_VER }}-
- ${{ runner.os }}-vcpkg-download-
- - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
+ ruby-version: '3.0'
+ bundler: none
+ windows-toolchain: none
+
+ - name: Export GitHub Actions cache environment variables
+ uses: actions/github-script@v7
with:
- path: C:\vcpkg\installed
- key: ${{ runner.os }}-vcpkg-installed-${{ matrix.os }}-${{ github.sha }}
- restore-keys: |
- ${{ runner.os }}-vcpkg-installed-${{ matrix.os }}-
- ${{ runner.os }}-vcpkg-installed-
+ script: |
+ core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
+ core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
+
- name: Install libraries with vcpkg
run: |
- vcpkg --triplet x64-windows install libffi libyaml openssl readline zlib
+ vcpkg --triplet x64-windows install gmp libffi libyaml openssl zlib
+ env:
+ VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
+
- name: Install libraries with scoop
run: |
iex "& {$(irm get.scoop.sh)} -RunAsAdmin"
Join-Path (Resolve-Path ~).Path "scoop\shims" >> $Env:GITHUB_PATH
shell: pwsh
- - name: git config
- run: |
- git config --global core.autocrlf false
- git config --global core.eol lf
- git config --global advice.detachedHead 0
- git config --global init.defaultBranch garbage
- - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
+
+ - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
- path: src
- - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
+ sparse-checkout-cone-mode: false
+ sparse-checkout: /.github
+
+ - uses: ./.github/actions/setup/directories
with:
- path: src/.downloaded-cache
- key: downloaded-cache
+ srcdir: src
+ builddir: build
+
- name: setup env
+ # Available Ruby versions: https://github.com/actions/runner-images/blob/main/images/windows/Windows2019-Readme.md#ruby
# %TEMP% is inconsistent with %TMP% and test-all expects they are consistent.
# https://github.com/actions/virtual-environments/issues/712#issuecomment-613004302
run: |
set VS=${{ matrix.vs }}
- set VCVARS=${{ matrix.vcvars }}
- if not "%VCVARS%" == "" goto :vcset
- set VCVARS="C:\Program Files (x86)\Microsoft Visual Studio\%VS%\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
- if not exist %VCVARS% set VCVARS="C:\Program Files\Microsoft Visual Studio\%VS%\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
- :vcset
+ set VCVARS="C:\Program Files (x86)\Microsoft Visual Studio\%VS%\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
+ if not exist %VCVARS% set VCVARS="C:\Program Files\Microsoft Visual Studio\%VS%\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
set | C:\msys64\usr\bin\sort > old.env
- call %VCVARS%
+ call %VCVARS% ${{ matrix.vcvars || '' }}
+ nmake -f nul
set TMP=%USERPROFILE%\AppData\Local\Temp
set TEMP=%USERPROFILE%\AppData\Local\Temp
+ set MAKEFLAGS=l
set /a TEST_JOBS=(15 * %NUMBER_OF_PROCESSORS% / 10) > nul
set | C:\msys64\usr\bin\sort > new.env
C:\msys64\usr\bin\comm -13 old.env new.env >> %GITHUB_ENV%
del *.env
+
+ - name: baseruby version
+ run: ruby -v
+
- name: compiler version
run: cl
+
- name: link libraries
run: |
for %%I in (C:\vcpkg\installed\x64-windows\bin\*.dll) do (
if not %%~nI == readline mklink %%~nxI %%I
)
+ # We use OpenSSL instealled by vcpkg instead
+ - name: disable system OpenSSL
+ run: |
for %%I in (libcrypto-1_1-x64 libssl-1_1-x64) do (
ren c:\Windows\System32\%%I.dll %%I.dll_
)
+ # windows-2019 image doesn't have OpenSSL as of 2023/9/14
+ if: ${{ matrix.vs != 2019 }}
+
- name: Configure
run: >-
../src/win32/configure.bat --disable-install-doc
--with-opt-dir=C:/vcpkg/installed/x64-windows
+
- run: nmake incs
+
- run: nmake extract-extlibs
+
+ # On all other platforms, test-spec depending on extract-gems (in common.mk) is enough.
+ # But not for this Visual Studio workflow. So here we extract gems before building.
+ - run: nmake extract-gems
+
- run: nmake
+
- run: nmake test
timeout-minutes: 5
- - run: nmake test-spec MSPECOPT="-V -fspec"
+
+ - run: nmake test-spec
timeout-minutes: 10
+
- run: nmake test-all
env:
- RUBY_TESTOPTS: -j${{env.TEST_JOBS}} --job-status=normal
+ RUBY_TESTOPTS: -j${{ env.TEST_JOBS || 4 }} --job-status=normal
timeout-minutes: 60
- - uses: ruby/action-slack@0bd85c72233cdbb6a0fe01d37aaeff1d21b5fce1 # v3.2.1
+
+ - uses: ./.github/actions/slack
with:
- payload: |
- {
- "ci": "GitHub Actions",
- "env": "VS${{ matrix.vs }} / ${{ matrix.test_task || 'check' }}",
- "url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
- "commit": "${{ github.sha }}",
- "branch": "${{ github.ref_name }}"
- }
- env:
+ label: VS${{ matrix.vc || matrix.vs }} / ${{ matrix.test_task || 'check' }}
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
- if: ${{ failure() && github.event_name == 'push' }}
+ if: ${{ failure() }}
defaults:
run:
diff --git a/.github/workflows/yjit-macos.yml b/.github/workflows/yjit-macos.yml
new file mode 100644
index 0000000000..6531737120
--- /dev/null
+++ b/.github/workflows/yjit-macos.yml
@@ -0,0 +1,170 @@
+name: YJIT macOS Arm64
+on:
+ push:
+ paths-ignore:
+ - 'doc/**'
+ - '**/man/*'
+ - '**.md'
+ - '**.rdoc'
+ - '**/.document'
+ - '.*.yml'
+ pull_request:
+ # Do not use paths-ignore for required status checks
+ # 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
+ merge_group:
+
+concurrency:
+ group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }}
+ cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }}
+
+permissions:
+ contents: read
+
+jobs:
+ cargo:
+ name: cargo test
+
+ runs-on: ${{ github.repository == 'ruby/ruby' && 'macos-arm-oss' || 'macos-14' }}
+
+ if: >-
+ ${{!(false
+ || contains(github.event.head_commit.message, '[DOC]')
+ || contains(github.event.head_commit.message, 'Document')
+ || contains(github.event.pull_request.title, '[DOC]')
+ || contains(github.event.pull_request.title, 'Document')
+ || contains(github.event.pull_request.labels.*.name, 'Document')
+ || (github.event_name == 'push' && github.actor == 'dependabot[bot]')
+ )}}
+
+ steps:
+ - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+
+ - run: RUST_BACKTRACE=1 cargo test
+ working-directory: yjit
+
+ # Also compile and test with all features enabled
+ - run: RUST_BACKTRACE=1 cargo test --all-features
+ working-directory: yjit
+
+ # Check that we can build in release mode too
+ - run: cargo build --release
+ working-directory: yjit
+
+ make:
+ strategy:
+ matrix:
+ include:
+ - test_task: 'check'
+ configure: '--enable-yjit'
+ yjit_opts: '--yjit'
+ - test_task: 'check'
+ configure: '--enable-yjit=dev'
+ yjit_opts: '--yjit-call-threshold=1 --yjit-verify-ctx --yjit-code-gc'
+ specopts: '-T --yjit-call-threshold=1 -T --yjit-verify-ctx -T --yjit-code-gc'
+ fail-fast: false
+
+ env:
+ GITPULLOPTIONS: --no-tags origin ${{ github.ref }}
+ RUN_OPTS: ${{ matrix.yjit_opts }}
+ SPECOPTS: ${{ matrix.specopts }}
+
+ runs-on: ${{ github.repository == 'ruby/ruby' && 'macos-arm-oss' || 'macos-14' }}
+
+ if: >-
+ ${{!(false
+ || contains(github.event.head_commit.message, '[DOC]')
+ || contains(github.event.head_commit.message, 'Document')
+ || contains(github.event.pull_request.title, '[DOC]')
+ || contains(github.event.pull_request.title, 'Document')
+ || contains(github.event.pull_request.labels.*.name, 'Document')
+ || (github.event_name == 'push' && github.actor == 'dependabot[bot]')
+ )}}
+
+ steps:
+ - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ with:
+ sparse-checkout-cone-mode: false
+ sparse-checkout: /.github
+
+ - name: Install libraries
+ uses: ./.github/actions/setup/macos
+
+ - uses: ./.github/actions/setup/directories
+ with:
+ srcdir: src
+ builddir: build
+ makeup: true
+ dummy-files: ${{ matrix.test_task == 'check' }}
+ # Set fetch-depth: 10 so that Launchable can receive commits information.
+ fetch-depth: 10
+
+ - name: Run configure
+ run: ../src/configure -C --disable-install-doc ${{ matrix.configure }}
+
+ - run: make prepare-gems
+ if: ${{ matrix.test_task == 'test-bundled-gems' }}
+
+ - run: make
+
+ - name: Enable YJIT through ENV
+ run: echo "RUBY_YJIT_ENABLE=1" >> $GITHUB_ENV
+
+ - name: Set test options for skipped tests
+ run: |
+ set -x
+ TESTS="$(echo "${{ matrix.skipped_tests }}" | sed 's| |$$/ -n!/|g;s|^|-n!/|;s|$|$$/|')"
+ echo "TESTS=${TESTS}" >> $GITHUB_ENV
+ if: ${{ matrix.test_task == 'check' && matrix.skipped_tests }}
+
+ - name: Set up Launchable
+ uses: ./.github/actions/launchable/setup
+ with:
+ os: ${{ github.repository == 'ruby/ruby' && 'macos-arm-oss' || 'macos-14' }}
+ test-opts: ${{ matrix.configure }}
+ launchable-token: ${{ secrets.LAUNCHABLE_TOKEN }}
+ builddir: build
+ srcdir: src
+ continue-on-error: true
+
+ - name: make ${{ matrix.test_task }}
+ run: >-
+ make -s ${{ matrix.test_task }} ${TESTS:+TESTS="$TESTS"}
+ RUN_OPTS="$RUN_OPTS"
+ SPECOPTS="$SPECOPTS"
+ timeout-minutes: 60
+ env:
+ RUBY_TESTOPTS: '-q --tty=no'
+ TEST_BUNDLED_GEMS_ALLOW_FAILURES: ''
+ SYNTAX_SUGGEST_TIMEOUT: '5'
+ PRECHECK_BUNDLED_GEMS: 'no'
+ continue-on-error: ${{ matrix.continue-on-test_task || false }}
+
+ - name: make skipped tests
+ run: |
+ 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.test_task }} ${{ matrix.configure }} ${{ matrix.yjit_opts }}
+ SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
+ if: ${{ failure() }}
+
+ result:
+ if: ${{ always() }}
+ name: ${{ github.workflow }} result
+ runs-on: ${{ github.repository == 'ruby/ruby' && 'macos-arm-oss' || 'macos-14' }}
+ needs: [make]
+ steps:
+ - run: exit 1
+ working-directory:
+ if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
+
+defaults:
+ run:
+ working-directory: build
diff --git a/.github/workflows/yjit-ubuntu.yml b/.github/workflows/yjit-ubuntu.yml
index 9cb5c87120..729115fbdc 100644
--- a/.github/workflows/yjit-ubuntu.yml
+++ b/.github/workflows/yjit-ubuntu.yml
@@ -3,24 +3,15 @@ on:
push:
paths-ignore:
- 'doc/**'
- - '**/man'
+ - '**/man/*'
- '**.md'
- '**.rdoc'
- '**/.document'
+ - '.*.yml'
pull_request:
- paths-ignore:
- - 'doc/**'
- - '**/man'
- - '**.md'
- - '**.rdoc'
- - '**/.document'
+ # Do not use paths-ignore for required status checks
+ # 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
merge_group:
- paths-ignore:
- - 'doc/**'
- - '**/man'
- - '**.md'
- - '**.rdoc'
- - '**/.document'
concurrency:
group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }}
@@ -31,146 +22,199 @@ permissions:
jobs:
cargo:
- name: Rust cargo test
+ name: cargo test
+
# GitHub Action's image seems to already contain a Rust 1.58.0.
runs-on: ubuntu-20.04
+
+ if: >-
+ ${{!(false
+ || contains(github.event.head_commit.message, '[DOC]')
+ || contains(github.event.pull_request.title, '[DOC]')
+ || contains(github.event.pull_request.labels.*.name, 'Document')
+ || (github.event_name == 'push' && github.actor == 'dependabot[bot]')
+ )}}
+
steps:
- - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
+ - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+
# For now we can't run cargo test --offline because it complains about the
# capstone dependency, even though the dependency is optional
#- run: cargo test --offline
+
- run: RUST_BACKTRACE=1 cargo test
working-directory: yjit
+
# Also compile and test with all features enabled
- run: RUST_BACKTRACE=1 cargo test --all-features
working-directory: yjit
+
# Check that we can build in release mode too
- run: cargo build --release
working-directory: yjit
+
lint:
- name: Rust lint
+ name: cargo clippy
+
# GitHub Action's image seems to already contain a Rust 1.58.0.
runs-on: ubuntu-20.04
+
+ if: >-
+ ${{!(false
+ || contains(github.event.head_commit.message, '[DOC]')
+ || contains(github.event.pull_request.title, '[DOC]')
+ || contains(github.event.pull_request.labels.*.name, 'Document')
+ || (github.event_name == 'push' && github.actor == 'dependabot[bot]')
+ )}}
+
steps:
- - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
+ - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+
# Check that we don't have linting errors in release mode, too
- run: cargo clippy --all-targets --all-features
working-directory: yjit
+
make:
strategy:
fail-fast: false
matrix:
include:
- - test_task: "yjit-bindgen"
- hint: "To fix: use patch in logs"
- configure: "--with-gcc=clang-12 --enable-yjit=dev"
+ - test_task: 'yjit-bindgen'
+ hint: 'To fix: use patch in logs'
+ configure: '--with-gcc=clang-12 --enable-yjit=dev'
- - test_task: "check"
+ - test_task: 'check'
# YJIT should be automatically built in release mode on x86-64 Linux with rustc present
#configure: "--enable-yjit RUSTC='rustc +1.58.0'"
configure: "RUSTC='rustc +1.58.0'"
- rust_version: "1.58.0"
+ rust_version: '1.58.0'
- - test_task: "check"
- configure: "--enable-yjit=dev"
+ - test_task: 'check'
+ configure: '--enable-yjit=dev'
- - test_task: "check"
- configure: "--enable-yjit=dev"
- yjit_opts: "--yjit-call-threshold=1 --yjit-verify-ctx"
+ - test_task: 'check'
+ configure: '--enable-yjit=dev'
+ yjit_opts: '--yjit-call-threshold=1 --yjit-verify-ctx --yjit-code-gc'
+ specopts: '-T --yjit-call-threshold=1 -T --yjit-verify-ctx -T --yjit-code-gc'
- - test_task: "test-all TESTS=--repeat-count=2"
- configure: "--enable-yjit=dev"
+ - test_task: 'test-bundled-gems'
+ configure: '--enable-yjit=dev'
- - test_task: "test-bundled-gems"
- configure: "--enable-yjit=dev"
+ - test_task: 'yjit-bench'
+ configure: '--enable-yjit=dev'
+ yjit_bench_opts: '--yjit-stats'
+ continue-on-test_task: true
- - test_task: "yjit-bench"
- configure: "--enable-yjit=dev"
- yjit_bench_opts: "--yjit-stats"
env:
- GITPULLOPTIONS: --no-tags origin ${{github.ref}}
+ GITPULLOPTIONS: --no-tags origin ${{ github.ref }}
RUN_OPTS: ${{ matrix.yjit_opts }}
YJIT_BENCH_OPTS: ${{ matrix.yjit_bench_opts }}
+ SPECOPTS: ${{ matrix.specopts }}
RUBY_DEBUG: ci
BUNDLE_JOBS: 8 # for yjit-bench
RUST_BACKTRACE: 1
+
runs-on: ubuntu-20.04
- if: ${{ !contains(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }}
+
+ if: >-
+ ${{!(false
+ || contains(github.event.head_commit.message, '[DOC]')
+ || contains(github.event.head_commit.message, 'Document')
+ || contains(github.event.pull_request.title, '[DOC]')
+ || contains(github.event.pull_request.title, 'Document')
+ || contains(github.event.pull_request.labels.*.name, 'Document')
+ || (github.event_name == 'push' && github.actor == 'dependabot[bot]')
+ )}}
+
steps:
- - run: mkdir build
- working-directory:
- - 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 autoconf ruby
+ - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ with:
+ sparse-checkout-cone-mode: false
+ sparse-checkout: /.github
+
+ - uses: ./.github/actions/setup/ubuntu
+
+ - uses: ruby/setup-ruby@3783f195e29b74ae398d7caca108814bbafde90e # v1.180.1
+ with:
+ ruby-version: '3.0'
+ bundler: none
+
+ - uses: ./.github/actions/setup/directories
+ with:
+ srcdir: src
+ builddir: build
+ makeup: true
+ dummy-files: ${{ matrix.test_task == 'check' }}
+ # Set fetch-depth: 10 so that Launchable can receive commits information.
+ fetch-depth: 10
+
- name: Install Rust
if: ${{ matrix.rust_version }}
run: rustup install ${{ matrix.rust_version }} --profile minimal
- - name: git config
- run: |
- git config --global advice.detachedHead 0
- git config --global init.defaultBranch garbage
- - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- with:
- path: src
- - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
- with:
- path: src/.downloaded-cache
- key: downloaded-cache
- - name: Fixed world writable dirs
- run: |
- chmod -v go-w $HOME $HOME/.config
- sudo chmod -R go-w /usr/share
- sudo bash -c 'IFS=:; for d in '"$PATH"'; do chmod -v go-w $d; done' || :
- - name: Set ENV
- run: |
- echo "GNUMAKEFLAGS=-j$((1 + $(nproc --all)))" >> $GITHUB_ENV
- - run: ./autogen.sh
- working-directory: src
+
- name: Run configure
run: ../src/configure -C --disable-install-doc --prefix=$(pwd)/install ${{ matrix.configure }}
+
- run: make incs
+
- run: make prepare-gems
if: ${{ matrix.test_task == 'test-bundled-gems' }}
- - run: make -j
- - name: Create dummy files in build dir
- run: |
- ./miniruby -e '(("a".."z").to_a+("A".."Z").to_a+("0".."9").to_a+%w[foo bar test zzz]).each{|basename|File.write("#{basename}.rb", "raise %(do not load #{basename}.rb)")}'
- if: ${{ matrix.test_task == 'check' }}
+
+ - run: make
+
- name: Enable YJIT through ENV
run: echo "RUBY_YJIT_ENABLE=1" >> $GITHUB_ENV
+
# Check that the binary was built with YJIT
- name: Check YJIT enabled
run: ./miniruby --yjit -v | grep "+YJIT"
+
+ - name: Set up Launchable
+ uses: ./.github/actions/launchable/setup
+ with:
+ os: ubuntu-20.04
+ test-opts: ${{ matrix.configure }}
+ launchable-token: ${{ secrets.LAUNCHABLE_TOKEN }}
+ builddir: build
+ srcdir: src
+ continue-on-error: true
+
- name: make ${{ matrix.test_task }}
- run: make -s -j ${{ matrix.test_task }} RUN_OPTS="$RUN_OPTS" YJIT_BENCH_OPTS="$YJIT_BENCH_OPTS"
- timeout-minutes: 60
+ run: >-
+ make -s ${{ matrix.test_task }} ${TESTS:+TESTS="$TESTS"}
+ RUN_OPTS="$RUN_OPTS" MSPECOPT=--debug SPECOPTS="$SPECOPTS"
+ YJIT_BENCH_OPTS="$YJIT_BENCH_OPTS" YJIT_BINDGEN_DIFF_OPTS="$YJIT_BINDGEN_DIFF_OPTS"
+ timeout-minutes: 90
env:
- RUBY_TESTOPTS: "-q --tty=no"
- TEST_BUNDLED_GEMS_ALLOW_FAILURES: ""
- PRECHECK_BUNDLED_GEMS: "no"
- SYNTAX_SUGGEST_TIMEOUT: "5"
- continue-on-error: ${{ matrix.test_task == 'yjit-bench' }}
+ RUBY_TESTOPTS: '-q --tty=no'
+ TEST_BUNDLED_GEMS_ALLOW_FAILURES: ''
+ PRECHECK_BUNDLED_GEMS: 'no'
+ SYNTAX_SUGGEST_TIMEOUT: '5'
+ YJIT_BINDGEN_DIFF_OPTS: '--exit-code'
+ continue-on-error: ${{ matrix.continue-on-test_task || false }}
+
- name: Show ${{ github.event.pull_request.base.ref }} GitHub URL for yjit-bench comparison
run: echo "https://github.com/${BASE_REPO}/commit/${BASE_SHA}"
env:
BASE_REPO: ${{ github.event.pull_request.base.repo.full_name }}
BASE_SHA: ${{ github.event.pull_request.base.sha }}
if: ${{ matrix.test_task == 'yjit-bench' && startsWith(github.event_name, 'pull') }}
- - uses: ruby/action-slack@0bd85c72233cdbb6a0fe01d37aaeff1d21b5fce1 # v3.2.1
+
+ - uses: ./.github/actions/slack
with:
- payload: |
- {
- "ci": "GitHub Actions",
- "env": "${{ github.workflow }} / ${{ matrix.test_task }} ${{ matrix.configure }}",
- "url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
- "commit": "${{ github.sha }}",
- "branch": "${{ github.ref_name }}"
- }
- env:
+ label: ${{ matrix.test_task }} ${{ matrix.configure }}
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
- if: ${{ failure() && github.event_name == 'push' }}
+ if: ${{ failure() }}
+
+ result:
+ if: ${{ always() }}
+ name: ${{ github.workflow }} result
+ runs-on: ubuntu-latest
+ needs: [make]
+ steps:
+ - run: exit 1
+ working-directory:
+ if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
defaults:
run: