summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/actions/launchable/setup/action.yml79
-rw-r--r--.github/workflows/annocheck.yml2
-rw-r--r--.github/workflows/baseruby.yml2
-rw-r--r--.github/workflows/check_dependencies.yml2
-rw-r--r--.github/workflows/dependabot_automerge.yml2
-rw-r--r--.github/workflows/modgc.yml2
-rw-r--r--.github/workflows/parse_y.yml2
-rw-r--r--.github/workflows/release.yml2
-rw-r--r--.github/workflows/scorecards.yml4
-rw-r--r--.github/workflows/spec_guards.yml2
-rw-r--r--.github/workflows/ubuntu.yml2
-rw-r--r--.github/workflows/wasm.yml6
-rw-r--r--.github/workflows/windows.yml2
-rw-r--r--.github/workflows/yjit-ubuntu.yml2
-rw-r--r--.github/workflows/zjit-macos.yml2
-rw-r--r--.github/workflows/zjit-ubuntu.yml4
-rw-r--r--test/io/console/test_io_console.rb3
-rwxr-xr-xtool/auto-style.rb16
-rw-r--r--tool/lib/envutil.rb6
19 files changed, 61 insertions, 81 deletions
diff --git a/.github/actions/launchable/setup/action.yml b/.github/actions/launchable/setup/action.yml
index 1cd28bf2d7..3a939452a3 100644
--- a/.github/actions/launchable/setup/action.yml
+++ b/.github/actions/launchable/setup/action.yml
@@ -57,12 +57,12 @@ inputs:
outputs:
stdout_report_path:
- value: ${{ steps.variables.outputs.stdout_report_path }}
+ value: ${{ steps.global.outputs.stdout_report_path }}
description: >-
Report file path for standard output.
stderr_report_path:
- value: ${{ steps.variables.outputs.stderr_report_path }}
+ value: ${{ steps.global.outputs.stderr_report_path }}
description: >-
Report file path for standard error.
@@ -114,6 +114,8 @@ runs:
echo test_all_report_file='launchable_test_all_report.json' >> $GITHUB_OUTPUT
echo btest_report_file='launchable_btest_report.json' >> $GITHUB_OUTPUT
echo test_spec_report_dir='launchable_test_spec_report' >> $GITHUB_OUTPUT
+ echo stdout_report_path="launchable_stdout.log" >> $GITHUB_OUTPUT
+ echo stderr_report_path="launchable_stderr.log" >> $GITHUB_OUTPUT
if: steps.enable-launchable.outputs.enable-launchable
- name: Set environment variables for Launchable
@@ -198,7 +200,10 @@ runs:
fi
if launchable_setup test_spec; then
echo "SPECOPTS=${SPECOPTS:$SPECOPTS }--launchable-test-reports=${test_spec_report_dir}" >> $GITHUB_ENV
+ echo test_spec_enabled=true >> $GITHUB_OUTPUT
fi
+
+ echo launchable_setup_dir=$(pwd) >> $GITHUB_OUTPUT
if: steps.enable-launchable.outputs.enable-launchable
env:
test_all_enabled: ${{ steps.global.outputs.test_all_enabled }}
@@ -208,6 +213,14 @@ runs:
btest_report_file: ${{ steps.global.outputs.btest_report_file }}
test_spec_report_dir: ${{ steps.global.outputs.test_spec_report_dir }}
+ - name: make test-spec report directory in build directory
+ shell: bash
+ working-directory: ${{ inputs.builddir }}
+ run: mkdir "${test_spec_report_dir}"
+ if: ${{ steps.setup-launchable.outputs.test_spec_enabled == 'true' }}
+ env:
+ test_spec_report_dir: ${{ steps.global.outputs.test_spec_report_dir }}
+
- name: Clean up test results in Launchable
uses: gacts/run-and-post-run@674528335da98a7afc80915ff2b4b860a0b3553a # v1.4.0
with:
@@ -225,52 +238,11 @@ runs:
btest_report_file: ${{ steps.global.outputs.btest_report_file }}
test_spec_report_dir: ${{ steps.global.outputs.test_spec_report_dir }}
- - name: Variables to report Launchable
- id: variables
- shell: bash
- working-directory: ${{ inputs.srcdir }}
- run: |
- set -x
- : # report-path from srcdir
- if [ "${srcdir}" = "${{ github.workspace }}" ]; then
- dir=
- else
- # srcdir must be equal to or under workspace
- dir=$(echo ${srcdir:+${srcdir}/} | sed 's:[^/][^/]*/:../:g')
- fi
- if [ "${test_all_enabled}" = "true" ]; then
- test_report_path="${dir}${builddir:+${builddir}/}${test_all_report_file}"
- echo test_report_path="${test_report_path}" >> $GITHUB_OUTPUT
- fi
- if [ "${btest_enabled}" = "true" ]; then
- btest_report_path="${dir}${builddir:+${builddir}/}${btest_report_file}"
- echo btest_report_path="${btest_report_path}" >> $GITHUB_OUTPUT
- fi
- if [ "${test_spec_enabled}" = "true" ]; then
- test_spec_report_path="${dir}${builddir:+${builddir}/}${test_spec_report_dir}"
- mkdir "${test_spec_report_path}"
- echo test_spec_report_path="${test_spec_report_path}" >> $GITHUB_OUTPUT
- fi
- stdout_report_path="${dir}${builddir:+${builddir}/}launchable_stdout.log"
- stderr_report_path="${dir}${builddir:+${builddir}/}launchable_stderr.log"
- echo stdout_report_path="${stdout_report_path}" >> $GITHUB_OUTPUT
- echo stderr_report_path="${stderr_report_path}" >> $GITHUB_OUTPUT
- if: steps.enable-launchable.outputs.enable-launchable
- env:
- srcdir: ${{ inputs.srcdir }}
- builddir: ${{ inputs.builddir }}
- test_all_enabled: ${{ steps.global.outputs.test_all_enabled }}
- btest_enabled: ${{ steps.global.outputs.btest_enabled }}
- test_spec_enabled: ${{ steps.global.outputs.test_spec_enabled }}
- test_all_report_file: ${{ steps.global.outputs.test_all_report_file }}
- btest_report_file: ${{ steps.global.outputs.btest_report_file }}
- test_spec_report_dir: ${{ steps.global.outputs.test_spec_report_dir }}
-
- name: Record test results in Launchable
uses: gacts/run-and-post-run@674528335da98a7afc80915ff2b4b860a0b3553a # v1.4.0
with:
shell: bash
- working-directory: ${{ inputs.srcdir }}
+ working-directory: ${{ inputs.builddir }}
post: |
if [[ "${test_all_enabled}" = "true" ]]; then \
launchable record attachment \
@@ -279,7 +251,7 @@ runs:
"${stderr_report_path}"; \
launchable record tests \
--session "${test_all_session}" \
- raw "${test_report_path}" || true; \
+ raw "${test_all_report_file}" || true; \
fi
if [[ "${btest_enabled}" = "true" ]]; then \
@@ -289,7 +261,7 @@ runs:
"${stderr_report_path}"; \
launchable record tests \
--session "${btest_session}" \
- raw "${btest_report_path}" || true; \
+ raw "${btest_report_file}" || true; \
fi
if [[ "${test_spec_enabled}" = "true" ]]; then \
@@ -299,18 +271,19 @@ runs:
"${stderr_report_path}"; \
launchable record tests \
--session "${test_spec_session}" \
- raw ${test_spec_report_path}/* || true; \
+ raw ${test_spec_report_dir}/* || true; \
fi
- if: ${{ always() && steps.enable-launchable.outputs.enable-launchable }}
+ if: ${{ always() && steps.setup-launchable.outcome == 'success' }}
env:
- test_report_path: ${{ steps.variables.outputs.test_report_path }}
- btest_report_path: ${{ steps.variables.outputs.btest_report_path }}
- test_spec_report_path: ${{ steps.variables.outputs.test_spec_report_path }}
+ test_all_report_file: ${{ steps.global.outputs.test_all_report_file }}
+ btest_report_file: ${{ steps.global.outputs.btest_report_file }}
+ test_spec_report_dir: ${{ steps.global.outputs.test_spec_report_dir }}
test_all_enabled: ${{ steps.global.outputs.test_all_enabled }}
btest_enabled: ${{ steps.global.outputs.btest_enabled }}
test_spec_enabled: ${{ steps.global.outputs.test_spec_enabled }}
test_all_session: ${{ steps.setup-launchable.outputs.test_all_session }}
btest_session: ${{ steps.setup-launchable.outputs.btest_session }}
test_spec_session: ${{ steps.setup-launchable.outputs.test_spec_session }}
- stdout_report_path: ${{ steps.variables.outputs.stdout_report_path }}
- stderr_report_path: ${{ steps.variables.outputs.stderr_report_path }}
+ stdout_report_path: ${{ steps.global.outputs.stdout_report_path }}
+ stderr_report_path: ${{ steps.global.outputs.stderr_report_path }}
+ LAUNCHABLE_SETUP_DIR: ${{ steps.setup-launchable.outputs.launchable_setup_dir }}
diff --git a/.github/workflows/annocheck.yml b/.github/workflows/annocheck.yml
index dcff2d699a..a890fc442f 100644
--- a/.github/workflows/annocheck.yml
+++ b/.github/workflows/annocheck.yml
@@ -74,7 +74,7 @@ jobs:
builddir: build
makeup: true
- - uses: ruby/setup-ruby@d8d83c3960843afb664e821fed6be52f37da5267 # v1.231.0
+ - uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
with:
ruby-version: '3.1'
bundler: none
diff --git a/.github/workflows/baseruby.yml b/.github/workflows/baseruby.yml
index 6b3974bc5b..8b77b01889 100644
--- a/.github/workflows/baseruby.yml
+++ b/.github/workflows/baseruby.yml
@@ -50,7 +50,7 @@ jobs:
- ruby-3.3
steps:
- - uses: ruby/setup-ruby@d8d83c3960843afb664e821fed6be52f37da5267 # v1.231.0
+ - uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
with:
ruby-version: ${{ matrix.ruby }}
bundler: none
diff --git a/.github/workflows/check_dependencies.yml b/.github/workflows/check_dependencies.yml
index aa3882c165..22452a3b9e 100644
--- a/.github/workflows/check_dependencies.yml
+++ b/.github/workflows/check_dependencies.yml
@@ -40,7 +40,7 @@ jobs:
- uses: ./.github/actions/setup/directories
- - uses: ruby/setup-ruby@d8d83c3960843afb664e821fed6be52f37da5267 # v1.231.0
+ - uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
with:
ruby-version: '3.1'
bundler: none
diff --git a/.github/workflows/dependabot_automerge.yml b/.github/workflows/dependabot_automerge.yml
index 28721a1335..09fdba7b2b 100644
--- a/.github/workflows/dependabot_automerge.yml
+++ b/.github/workflows/dependabot_automerge.yml
@@ -13,7 +13,7 @@ jobs:
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'ruby/ruby'
steps:
- name: Dependabot metadata
- uses: dependabot/fetch-metadata@d7267f607e9d3fb96fc2fbe83e0af444713e90b7 # v2.3.0
+ uses: dependabot/fetch-metadata@08eff52bf64351f401fb50d4972fa95b9f2c2d1b # v2.4.0
id: metadata
- name: Wait for status checks
diff --git a/.github/workflows/modgc.yml b/.github/workflows/modgc.yml
index e6ec8f3523..5b29da7516 100644
--- a/.github/workflows/modgc.yml
+++ b/.github/workflows/modgc.yml
@@ -63,7 +63,7 @@ jobs:
uses: ./.github/actions/setup/ubuntu
if: ${{ contains(matrix.os, 'ubuntu') }}
- - uses: ruby/setup-ruby@d8d83c3960843afb664e821fed6be52f37da5267 # v1.231.0
+ - uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
with:
ruby-version: '3.1'
bundler: none
diff --git a/.github/workflows/parse_y.yml b/.github/workflows/parse_y.yml
index 824dea5d32..e9c41923a3 100644
--- a/.github/workflows/parse_y.yml
+++ b/.github/workflows/parse_y.yml
@@ -60,7 +60,7 @@ jobs:
- uses: ./.github/actions/setup/ubuntu
- - uses: ruby/setup-ruby@d8d83c3960843afb664e821fed6be52f37da5267 # v1.231.0
+ - uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
with:
ruby-version: '3.1'
bundler: none
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 25916066d6..284e336a29 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -55,7 +55,7 @@ jobs:
echo $PREVIOUS_RELEASE_TAG
tool/gen-github-release.rb $PREVIOUS_RELEASE_TAG $RELEASE_TAG --no-dry-run
env:
- GITHUB_TOKEN: ${{ secrets.MATZBOT_GITHUB_WORKFLOW_TOKEN }}
+ GITHUB_TOKEN: ${{ secrets.MATZBOT_AUTO_UPDATE_TOKEN }}
- name: Update versions index
run: |
diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml
index 7afd96c3bb..3b43080201 100644
--- a/.github/workflows/scorecards.yml
+++ b/.github/workflows/scorecards.yml
@@ -39,7 +39,7 @@ jobs:
persist-credentials: false
- name: "Run analysis"
- uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
+ uses: ossf/scorecard-action@f2ea147fec3c2f0d459703eba7405b5e9bcd8c8f # v2.4.2
with:
results_file: results.sarif
results_format: sarif
@@ -64,7 +64,7 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
- uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: SARIF file
path: results.sarif
diff --git a/.github/workflows/spec_guards.yml b/.github/workflows/spec_guards.yml
index ef67e1a505..d723abde21 100644
--- a/.github/workflows/spec_guards.yml
+++ b/.github/workflows/spec_guards.yml
@@ -48,7 +48,7 @@ jobs:
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- - uses: ruby/setup-ruby@d8d83c3960843afb664e821fed6be52f37da5267 # v1.231.0
+ - uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
with:
ruby-version: ${{ matrix.ruby }}
bundler: none
diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml
index 041cb412fd..f1c185f4c1 100644
--- a/.github/workflows/ubuntu.yml
+++ b/.github/workflows/ubuntu.yml
@@ -68,7 +68,7 @@ jobs:
with:
arch: ${{ matrix.arch }}
- - uses: ruby/setup-ruby@d8d83c3960843afb664e821fed6be52f37da5267 # v1.231.0
+ - uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
with:
ruby-version: '3.1'
bundler: none
diff --git a/.github/workflows/wasm.yml b/.github/workflows/wasm.yml
index 047288cb8d..2c49d99071 100644
--- a/.github/workflows/wasm.yml
+++ b/.github/workflows/wasm.yml
@@ -100,7 +100,7 @@ jobs:
run: |
echo "WASI_SDK_PATH=/opt/wasi-sdk" >> $GITHUB_ENV
- - uses: ruby/setup-ruby@d8d83c3960843afb664e821fed6be52f37da5267 # v1.231.0
+ - uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
with:
ruby-version: '3.1'
bundler: none
@@ -142,7 +142,7 @@ jobs:
- run: tar cfz ../install.tar.gz -C ../install .
- name: Upload artifacts
- uses: actions/upload-artifact@604373da6381bf24206979c74d06a550515601b9 # v4.4.1
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: ruby-wasm-install
path: ${{ github.workspace }}/install.tar.gz
@@ -170,7 +170,7 @@ jobs:
- 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@604373da6381bf24206979c74d06a550515601b9 # v4.4.1
+ - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: ${{ github.event_name == 'pull_request' }}
with:
name: github-pr-info
diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml
index e0719118b4..39f67abdc4 100644
--- a/.github/workflows/windows.yml
+++ b/.github/workflows/windows.yml
@@ -64,7 +64,7 @@ jobs:
- run: md build
working-directory:
- - uses: ruby/setup-ruby@e34163cd15f4bb403dcd72d98e295997e6a55798 # v1.238.0
+ - uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
with:
# windows-11-arm has only 3.4.1, 3.4.2, 3.4.3, head
ruby-version: ${{ !endsWith(matrix.os, 'arm') && '3.1' || '3.4' }}
diff --git a/.github/workflows/yjit-ubuntu.yml b/.github/workflows/yjit-ubuntu.yml
index ee6c7cb5ed..252ffb9e54 100644
--- a/.github/workflows/yjit-ubuntu.yml
+++ b/.github/workflows/yjit-ubuntu.yml
@@ -135,7 +135,7 @@ jobs:
- uses: ./.github/actions/setup/ubuntu
- - uses: ruby/setup-ruby@d8d83c3960843afb664e821fed6be52f37da5267 # v1.231.0
+ - uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
with:
ruby-version: '3.1'
bundler: none
diff --git a/.github/workflows/zjit-macos.yml b/.github/workflows/zjit-macos.yml
index fa161b31a2..2bbcf6e831 100644
--- a/.github/workflows/zjit-macos.yml
+++ b/.github/workflows/zjit-macos.yml
@@ -63,7 +63,7 @@ jobs:
)}}
steps:
- - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
sparse-checkout-cone-mode: false
sparse-checkout: /.github
diff --git a/.github/workflows/zjit-ubuntu.yml b/.github/workflows/zjit-ubuntu.yml
index 7a6c1dfe0b..d120372979 100644
--- a/.github/workflows/zjit-ubuntu.yml
+++ b/.github/workflows/zjit-ubuntu.yml
@@ -69,14 +69,14 @@ jobs:
)}}
steps:
- - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
sparse-checkout-cone-mode: false
sparse-checkout: /.github
- uses: ./.github/actions/setup/ubuntu
- - uses: ruby/setup-ruby@a6e6f86333f0a2523ece813039b8b4be04560854 # v1.190.0
+ - uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
with:
ruby-version: '3.1'
bundler: none
diff --git a/test/io/console/test_io_console.rb b/test/io/console/test_io_console.rb
index 519184c537..2ed04c287b 100644
--- a/test/io/console/test_io_console.rb
+++ b/test/io/console/test_io_console.rb
@@ -367,6 +367,7 @@ defined?(PTY) and defined?(IO.console) and TestIO_Console.class_eval do
w.print cc
w.flush
result = EnvUtil.timeout(3) {r.gets}
+ result = yield result if defined?(yield)
assert_equal(expect, result.chomp)
end
@@ -404,7 +405,7 @@ defined?(PTY) and defined?(IO.console) and TestIO_Console.class_eval do
if cc = ctrl["intr"]
assert_ctrl("#{cc.ord}", cc, r, w)
assert_ctrl("#{cc.ord}", cc, r, w)
- assert_ctrl("Interrupt", cc, r, w) unless /linux/ =~ RUBY_PLATFORM
+ assert_ctrl("Interrupt", cc, r, w) {|res| res.sub("^C", "")} unless /linux/ =~ RUBY_PLATFORM
end
if cc = ctrl["dsusp"]
assert_ctrl("#{cc.ord}", cc, r, w)
diff --git a/tool/auto-style.rb b/tool/auto-style.rb
index 0c6ce6848a..71139c8eb8 100755
--- a/tool/auto-style.rb
+++ b/tool/auto-style.rb
@@ -15,8 +15,10 @@ class Git
@branch = branch
# GitHub may not fetch github.event.pull_request.base.sha at checkout
- git('fetch', '--depth=1', 'origin', @oldrev)
- git('fetch', '--depth=100', 'origin', @newrev)
+ git('log', '--format=%H', '-1', @oldrev, out: IO::NULL, err: [:child, :out]) or
+ git('fetch', '--depth=1', 'origin', @oldrev)
+ git('log', '--format=%H', '-1', "#@newrev~99", out: IO::NULL, err: [:child, :out]) or
+ git('fetch', '--depth=100', 'origin', @newrev)
with_clean_env do
@revs = {}
@@ -66,12 +68,14 @@ class Git
private
- def git(*args)
+ def git(*args, **opts)
cmd = ['git', *args].shelljoin
puts "+ #{cmd}"
- unless with_clean_env { system('git', *args) }
+ ret = with_clean_env { system('git', *args, **opts) }
+ unless ret or opts[:err]
abort "Failed to run: #{cmd}"
end
+ ret
end
def with_clean_env
@@ -233,8 +237,8 @@ edited_files = files.select do |f|
if File.fnmatch?("*.[ch]", f, File::FNM_PATHNAME) &&
!DIFFERENT_STYLE_FILES.any? {|pat| File.fnmatch?(pat, f, File::FNM_PATHNAME)}
- indent0 = true if src.gsub!(/^\w+\([^(\n)]*?\)\K[ \t]*(?=\{$)/, "\n")
- indent0 = true if src.gsub!(/^([ \t]*)\}\K[ \t]*(?=else\b)/, "\n" '\1')
+ indent0 = true if src.gsub!(/^\w+\([^\n]*?\)\K[ \t]*(?=\{( *\\)?$)/, '\1' "\n")
+ indent0 = true if src.gsub!(/^([ \t]*)\}\K[ \t]*(?=else\b.*?( *\\)?$)/, '\2' "\n" '\1')
indent0 = true if src.gsub!(/^[ \t]*\}\n\K\n+(?=[ \t]*else\b)/, '')
indent ||= indent0
end
diff --git a/tool/lib/envutil.rb b/tool/lib/envutil.rb
index 101ea350c6..d02329d4f1 100644
--- a/tool/lib/envutil.rb
+++ b/tool/lib/envutil.rb
@@ -158,10 +158,12 @@ module EnvUtil
pgroup = pid
end
+ dumped = false
while signal = signals.shift
- if (dbg = Debugger.search) and [:ABRT, :KILL].include?(signal)
- dbg.dump(pid)
+ if !dumped and [:ABRT, :KILL].include?(signal)
+ Debugger.search&.dump(pid)
+ dumped = true
end
begin