summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2026-05-21 19:05:01 +0900
committerTakashi Kokubun <takashikkbn@gmail.com>2026-05-21 19:54:50 -0700
commit2c90e65520d09381541ac036dcb69016b0fd2c3b (patch)
tree19bcc02c5492483f9e405b038ea6cfb76ea17eda
parentd7d742df85d588f3cb42f22a2e90f3c48c93385c (diff)
Reuse the script to save stats of HOMEruby_4_0
-rw-r--r--.github/workflows/tarball-ubuntu.yml37
1 files changed, 5 insertions, 32 deletions
diff --git a/.github/workflows/tarball-ubuntu.yml b/.github/workflows/tarball-ubuntu.yml
index 2693ddee88..1b21355f5a 100644
--- a/.github/workflows/tarball-ubuntu.yml
+++ b/.github/workflows/tarball-ubuntu.yml
@@ -62,8 +62,7 @@ jobs:
- name: Save stats of HOME
run: |
set -euxo pipefail
- cd "$ARCHNAME/"
- cat >test.rb <<'EOF'
+ cat >"$ARCHNAME/save-stats.rb" <<'EOF'
require 'pathname'
require 'digest'
out = []
@@ -82,12 +81,11 @@ jobs:
out << [pn.to_s, $!.inspect].to_s
end
end
- File.open("/tmp/stat-before-tests.txt", "w") do |io|
+ File.open(ARGV.shift, "w") do |io|
io.puts out.sort
end
EOF
- make runruby
- rm -f test.rb
+ make -C "$ARCHNAME" TESTRUN_SCRIPT=save-stats.rb RUNOPT=/tmp/stat-before-tests.txt runruby
- name: Tests
run: cd "$ARCHNAME/" && make $JOBS -s ${{ matrix.test_task }}
env:
@@ -98,33 +96,8 @@ jobs:
run: rm -rf $HOME/.gnupg
- name: Diff stats of HOME
run: |
- set -euxo pipefail
- cd "$ARCHNAME/"
- cat >test.rb <<'EOF'
- require 'pathname'
- require 'digest'
- out = []
- [
- Dir.home,
- ].each do |dir|
- Pathname(dir).each_child do |pn|
- st = pn.stat
- if st.file?
- content = Digest::SHA1.hexdigest(pn.read)
- elsif st.directory? && st.nlink <= 10
- content = pn.children.map(&:basename).map(&:to_s).sort
- end
- out << [pn.to_s, "%o"%st.mode, st.nlink, st.uid, st.gid, st.size, content].to_s
- rescue
- out << [pn.to_s, $!.inspect].to_s
- end
- end
- File.open("/tmp/stat-after-tests.txt", "w") do |io|
- io.puts out.sort
- end
- EOF
- make runruby
- rm -f test.rb
+ make -C "$ARCHNAME" TESTRUN_SCRIPT=save-stats.rb RUNOPT=/tmp/stat-after-tests.txt runruby
+ rm -f "$ARCHNAME/save-stats.rb"
diff -u /tmp/stat-before-tests.txt /tmp/stat-after-tests.txt
# leaked-globals since 2.7
- name: Leaked Globals