Skip to content

Commit 2726520

Browse files
author
devkadirselcuk
authored
Merge pull request ruby#49 from ruby/master
[pull] master from ruby:master
2 parents 85c9960 + 69380c6 commit 2726520

File tree

288 files changed

+9162
-3257
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

288 files changed

+9162
-3257
lines changed

.appveyor.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ shallow_clone: true
1010
clone_depth: 10
1111
platform:
1212
- x64
13+
skip_commits:
14+
message: /^\[DOC\]/
15+
files:
16+
- doc/*
17+
- '**/*.md'
18+
- '**/*.rdoc'
1319
environment:
1420
ruby_version: "24-%Platform%"
1521
zlib_version: "1.2.11"

.github/workflows/baseruby.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
baseruby:
2121
name: BASERUBY
2222
runs-on: ubuntu-20.04
23+
if: ${{ !startsWith(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }}
2324
strategy:
2425
matrix:
2526
ruby:

.github/workflows/bundled_gems.yml

Lines changed: 71 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
name: bundled_gems
22

33
on:
4+
push:
5+
paths:
6+
- '.github/workflows/bundled_gems.yml'
7+
- 'gems/bundled_gems'
8+
pull_request:
9+
paths:
10+
- '.github/workflows/bundled_gems.yml'
11+
- 'gems/bundled_gems'
412
schedule:
513
- cron: '45 6 * * *'
614

715
jobs:
816
update:
9-
if: ${{ github.repository == 'ruby/ruby' }}
17+
if: ${{ github.event_name != 'schedule' || github.repository == 'ruby/ruby' }}
1018
name: update ${{ github.workflow }}
1119
runs-on: ubuntu-latest
1220
steps:
@@ -18,17 +26,62 @@ jobs:
1826
- name: Set ENV
1927
run: |
2028
echo "GNUMAKEFLAGS=-j$((1 + $(nproc --all)))" >> $GITHUB_ENV
29+
echo "TODAY=$(date +%F)" >> $GITHUB_ENV
2130
2231
- uses: actions/checkout@v2
2332

24-
- name: Update ${{ github.workflow }}
33+
- uses: actions/cache@v2
34+
with:
35+
path: .downloaded-cache
36+
key: downloaded-cache-${{ github.sha }}
37+
restore-keys: |
38+
downloaded-cache
39+
40+
- name: Download previous gems list
41+
run: |
42+
data=bundled_gems.json
43+
mkdir -p .downloaded-cache
44+
ln -s .downloaded-cache/$data .
45+
curl -O -R -z ./$data https://stdgems.org/$data
46+
47+
- name: Update bundled gems list
48+
run: |
49+
ruby -i~ tool/update-bundled_gems.rb gems/bundled_gems
50+
51+
- name: Maintain updated gems list in NEWS
2552
run: |
26-
ruby -i~ tool/update-bundled_gems.rb gems/${{ github.workflow }}
53+
require 'json'
54+
news = File.read("NEWS.md")
55+
prev = news[/since the \*+(\d+\.\d+\.\d+)\*+/, 1]
56+
prevs = [prev, prev.sub(/\.\d+\z/, '')]
57+
%W[bundled].each do |type|
58+
last = JSON.parse(File.read("#{type}_gems.json"))['gems'].filter_map do |g|
59+
v = g['versions'].values_at(*prevs).compact.first
60+
g = g['gem']
61+
g = 'RubyGems' if g == 'rubygems'
62+
[g, v] if v
63+
end.to_h
64+
changed = File.foreach("gems/#{type}_gems").filter_map do |l|
65+
next if l.start_with?("#")
66+
g, v = l.split(" ", 3)
67+
[g, v] unless last[g] == v
68+
end
69+
changed, added = changed.partition {|g, _| last[g]}
70+
news.sub!(/^\*\s+The following #{type} gems? are updated\.(\n\s+\*\s+)\K.*(?:\1.*)*/) do
71+
changed.map {|g, v|"#{g} #{v}"}.join($1)
72+
end or exit
73+
news.sub!(/^\*\s+The following default gems are now bundled.*(\n\s+\*\s+)\K.*(?:\1.*)*/) do
74+
added.map {|g, v|"#{g} #{v}"}.join($1)
75+
end if added
76+
File.write("NEWS.md", news)
77+
end
78+
shell: ruby {0}
2779

2880
- name: Check diffs
2981
id: diff
3082
run: |
31-
git diff --no-ext-diff --ignore-submodules --exit-code
83+
git add -- NEWS.md
84+
git diff --no-ext-diff --ignore-submodules --quiet -- gems/bundled_gems
3285
continue-on-error: true
3386

3487
- name: Install libraries
@@ -38,11 +91,6 @@ jobs:
3891
sudo apt-get install --no-install-recommends -q -y build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev bison autoconf ruby
3992
if: ${{ steps.diff.outcome == 'failure' }}
4093

41-
- uses: actions/cache@v2
42-
with:
43-
path: .downloaded-cache
44-
key: downloaded-cache
45-
4694
- name: Build
4795
run: |
4896
./autogen.sh
@@ -53,19 +101,31 @@ jobs:
53101
- name: Test bundled gems
54102
run: |
55103
make -s test-bundled-gems
104+
git add -- gems/bundled_gems
56105
timeout-minutes: 30
57106
env:
58107
RUBY_TESTOPTS: "-q --tty=no"
59108
TEST_BUNDLED_GEMS_ALLOW_FAILURES: ""
60109
if: ${{ steps.diff.outcome == 'failure' }}
61110

111+
- name: Show diffs
112+
id: show
113+
run: |
114+
git diff --cached --color --no-ext-diff --ignore-submodules --exit-code --
115+
continue-on-error: true
116+
62117
- name: Commit
63118
run: |
64119
git pull --ff-only origin ${GITHUB_REF#refs/heads/}
65-
git commit --message="Update ${{ github.workflow }} at $(date +%F)" gems/$file
120+
message="Update bundled gems list at "
121+
if [ ${{ steps.diff.outcome }} = success ]; then
122+
git commit --message="${message}${GITHUB_SHA:0:30} [ci skip]"
123+
else
124+
git commit --message="${message}${TODAY}"
125+
fi
66126
git push origin ${GITHUB_REF#refs/heads/}
67127
env:
68128
69129
GIT_AUTHOR_NAME: git
70130
GIT_COMMITTER_NAME: git
71-
if: ${{ steps.diff.outcome == 'failure' }}
131+
if: ${{ github.repository == 'ruby/ruby' && !startsWith(github.event_name, 'pull') && steps.show.outcome == 'failure' }}

.github/workflows/check_dependencies.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
os: [ubuntu-20.04]
2323
fail-fast: true
2424
runs-on: ${{ matrix.os }}
25+
if: ${{ !startsWith(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }}
2526
steps:
2627
- name: Install libraries
2728
run: |

.github/workflows/check_misc.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,75 @@ jobs:
2222
git grep -l -F -e $header -e HAVE_`echo $header | tr a-z./ A-Z__` -- . > /dev/null || echo $header
2323
done | grep -F .
2424
working-directory: include
25+
26+
- uses: actions/cache@v2
27+
with:
28+
path: .downloaded-cache
29+
key: downloaded-cache-${{ github.sha }}
30+
restore-keys: |
31+
downloaded-cache
32+
33+
- name: Download previous gems list
34+
run: |
35+
data=default_gems.json
36+
mkdir -p .downloaded-cache
37+
ln -s .downloaded-cache/$data .
38+
curl -O -R -z ./$data https://stdgems.org/$data
39+
40+
- name: Make default gems list
41+
run: |
42+
require 'rubygems'
43+
$:.unshift "lib"
44+
rgver = File.foreach("lib/rubygems.rb") do |line|
45+
break $1 if /^\s*VERSION\s*=\s*"([^"]+)"/ =~ line
46+
end
47+
gems = Dir.glob("{ext,lib}/**/*.gemspec").map do |f|
48+
spec = Gem::Specification.load(f)
49+
"#{spec.name} #{spec.version}"
50+
end.sort
51+
File.open("gems/default_gems", "w") do |f|
52+
f.puts "RubyGems #{rgver}"
53+
f.puts gems
54+
end
55+
shell: ruby --disable=gems {0}
56+
57+
- name: Maintain updated gems list in NEWS
58+
run: |
59+
require 'json'
60+
news = File.read("NEWS.md")
61+
prev = news[/since the \*+(\d+\.\d+\.\d+)\*+/, 1]
62+
prevs = [prev, prev.sub(/\.\d+\z/, '')]
63+
%W[default].each do |type|
64+
last = JSON.parse(File.read("#{type}_gems.json"))['gems'].filter_map do |g|
65+
v = g['versions'].values_at(*prevs).compact.first
66+
g = g['gem']
67+
g = 'RubyGems' if g == 'rubygems'
68+
[g, v] if v
69+
end.to_h
70+
changed = File.foreach("gems/#{type}_gems").filter_map do |l|
71+
next if l.start_with?("#")
72+
g, v = l.split(" ", 3)
73+
[g, v] unless last[g] == v
74+
end
75+
news.sub!(/^\*\s+The following #{type} gems? are updated\.(\n\s+\*\s+)\K.*(?:\1.*)*/) do
76+
changed.map {|g, v|"#{g} #{v}"}.join($1)
77+
end or exit
78+
File.write("NEWS.md", news)
79+
end
80+
shell: ruby {0}
81+
82+
- name: Check diffs
83+
id: diff
84+
run: |
85+
git diff --color --no-ext-diff --ignore-submodules --exit-code NEWS.md
86+
continue-on-error: true
87+
- name: Commit
88+
run: |
89+
git pull --ff-only origin ${GITHUB_REF#refs/heads/}
90+
git commit --message="Update default gems list at ${GITHUB_SHA:0:30} [ci skip]" NEWS.md
91+
git push origin ${GITHUB_REF#refs/heads/}
92+
env:
93+
94+
GIT_AUTHOR_NAME: git
95+
GIT_COMMITTER_NAME: git
96+
if: ${{ github.repository == 'ruby/ruby' && !startsWith(github.event_name, 'pull') && steps.diff.outcome == 'failure' }}

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323

2424
# CodeQL runs on ubuntu-latest and windows-latest
2525
runs-on: ubuntu-latest
26+
if: ${{ !startsWith(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }}
2627

2728
env:
2829
enable_install_doc: no

.github/workflows/compilers.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ jobs:
188188
container:
189189
image: ghcr.io/ruby/ruby-ci-image:${{ matrix.entry.container || 'clang-14' }}
190190
options: --user root
191+
if: ${{ !startsWith(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }}
191192
steps:
192193
- run: id
193194
working-directory:

.github/workflows/mingw.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ jobs:
4242
base_ruby: head
4343
test_task: [ "check" ] # to make job names consistent
4444
fail-fast: false
45+
if: ${{ !startsWith(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }}
4546
steps:
4647
- run: mkdir build
4748
working-directory:

.github/workflows/mjit.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@ jobs:
2020
strategy:
2121
matrix:
2222
test_task: [ "check" ] # to make job names consistent
23-
jit_opts: [ "--jit", "--jit-wait" ]
23+
jit_opts: [ "--mjit", "--mjit-wait" ]
2424
fail-fast: false
2525
runs-on: ubuntu-latest
26+
if: ${{ !startsWith(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }}
2627
env:
2728
TESTOPTS: '-q --tty=no'
28-
RUN_OPTS: '--disable-gems ${{ matrix.jit_opts }} --jit-debug=-ggdb3'
29+
RUN_OPTS: '--disable-gems ${{ matrix.jit_opts }} --mjit-debug=-ggdb3'
2930
GITPULLOPTIONS: --no-tags origin ${{github.ref}}
3031
steps:
3132
- run: mkdir build

.github/workflows/spec_guards.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
rubyspec:
2121
name: Rubyspec
2222
runs-on: ubuntu-20.04
23+
if: ${{ !startsWith(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }}
2324
strategy:
2425
matrix:
2526
# Specs from ruby/spec should still run on all supported Ruby versions.

0 commit comments

Comments
 (0)