Skip to content

Commit

Permalink
Merge branch 'ruby:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
artur-intech authored Apr 26, 2024
2 parents ecaa275 + 500586b commit 4dce609
Show file tree
Hide file tree
Showing 1,143 changed files with 38,507 additions and 24,137 deletions.
7 changes: 0 additions & 7 deletions .github/CODEOWNERS

This file was deleted.

40 changes: 0 additions & 40 deletions .github/actions/launchable/record-test/action.yml

This file was deleted.

66 changes: 59 additions & 7 deletions .github/actions/launchable/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,36 @@ inputs:
required: true
description: The file path of the test report for uploading to Launchable

os:
required: true
description: The operating system that CI runs on. This value is used in Launchable flavor.

test-opts:
default: none
required: false
description: >-
Test options that determine how tests are run.
This value is used in the Launchable flavor.
launchable-token:
required: false
description: >-
Launchable token is needed if you want to run Launchable on your forked repository.
See https://github.com/ruby/ruby/wiki/CI-Servers#launchable-ci for details.
builddir:
required: false
default: ${{ github.workspace }}
description: >-
Directory to create Launchable report file.
srcdir:
required: false
default: ${{ github.workspace }}
description: >-
Directory to (re-)checkout source codes. Launchable retrives the commit information
from the directory.
outputs:
enable-launchable:
description: "The boolean value indicating whether Launchable is enabled or not"
value: ${{ steps.enable-launchable.outputs.enable-launchable }}

runs:
using: composite

Expand Down Expand Up @@ -79,9 +91,10 @@ runs:
PATH=$PATH:$(python -msite --user-base)/bin
echo "PATH=$PATH" >> $GITHUB_ENV
pip install --user launchable
launchable verify
launchable verify || true
: # The build name cannot include a slash, so we replace the string here.
github_ref="$(echo ${{ github.ref }} | sed 's/\//_/g')"
github_ref="${{ github.ref }}"
github_ref="${github_ref//\//_}"
: # With the --name option, we need to configure a unique identifier for this build.
: # To avoid setting the same build name as the CI which runs on other branches, we use the branch name here.
: #
Expand All @@ -90,3 +103,42 @@ runs:
launchable record build --name ${github_ref}_${GITHUB_PR_HEAD_SHA}
echo "TESTS=${TESTS} --launchable-test-reports=${{ inputs.report-path }}" >> $GITHUB_ENV
if: steps.enable-launchable.outputs.enable-launchable

- name: Variables to report Launchable
id: variables
shell: bash
run: |
set -x
: # flavor
test_opts="${{ inputs.test-opts }}"
test_opts="${test_opts// /}"
test_opts="${test_opts//=/:}"
echo test-opts="$test_opts" >> $GITHUB_OUTPUT
: # 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
report_path="${dir}${builddir:+${builddir}/}${report_path}"
echo report-path="${report_path}" >> $GITHUB_OUTPUT
if: steps.enable-launchable.outputs.enable-launchable
env:
srcdir: ${{ inputs.srcdir }}
builddir: ${{ inputs.builddir }}
report_path: ${{ inputs.report-path }}

- name: Record test results in Launchable
uses: gacts/run-and-post-run@674528335da98a7afc80915ff2b4b860a0b3553a # v1.4.0
with:
shell: bash
working-directory: ${{ inputs.srcdir }}
post: |
: # record
launchable record tests --flavor os=${{ inputs.os }} --flavor test_task=${{ matrix.test_task }} --flavor test_opts=${test_opts} raw ${report_path}
rm -f ${report_path}
if: ${{ always() && steps.enable-launchable.outputs.enable-launchable }}
env:
test_opts: ${{ steps.variables.outputs.test-opts }}
report_path: ${{ steps.variables.outputs.report-path }}
39 changes: 35 additions & 4 deletions .github/actions/setup/directories/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ inputs:
default: '1'
description: The depth of commit history fetched from the remote repository

clean:
required: false
type: boolean
default: ''
description: >-
If set to true, clean build directory.
outputs: {} # nothing?

runs:
Expand Down Expand Up @@ -81,12 +88,12 @@ runs:
git config --global init.defaultBranch garbage
- if: inputs.checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
path: ${{ inputs.srcdir }}
fetch-depth: ${{ inputs.fetch-depth }}

- uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ${{ inputs.srcdir }}/.downloaded-cache
key: downloaded-cache
Expand Down Expand Up @@ -135,9 +142,33 @@ runs:
- if: inputs.dummy-files == 'true'
shell: bash
id: dummy-files
working-directory: ${{ inputs.builddir }}
run: |
: Create dummy files in build dir
for basename in {a..z} {A..Z} {0..9} foo bar test zzz; do
echo > ${basename}.rb "raise %(do not load ${basename}.rb)"
set {{a..z},{A..Z},{0..9},foo,bar,test,zzz}.rb
for file; do \
echo > $file "raise 'do not load $file'"; \
done
# drop {a..z}.rb if case-insensitive filesystem
grep -F A.rb a.rb > /dev/null && set "${@:27}"
echo clean="cd ${{ inputs.builddir }} && rm $*" >> $GITHUB_OUTPUT
- if: inputs.clean == 'true'
shell: bash
id: clean
run: |
echo distclean='make -C ${{ inputs.builddir }} distclean' >> $GITHUB_OUTPUT
echo remained-files='find ${{ inputs.builddir }} -ls' >> $GITHUB_OUTPUT
[ "${{ inputs.builddir }}" = "${{ inputs.srcdir }}" ] ||
echo final='rmdir ${{ inputs.builddir }}' >> $GITHUB_OUTPUT
- name: clean
uses: gacts/run-and-post-run@7aec950f3b114c4fcf6012070c3709ecff0eb6f8 # v1.4.0
with:
working-directory:
post: |
${{ steps.dummy-files.outputs.clean }}
${{ steps.clean.outputs.distclean }}
${{ steps.clean.outputs.remained-files }}
${{ steps.clean.outputs.final }}
13 changes: 13 additions & 0 deletions .github/auto_request_review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
files:
'yjit*': [team:yjit]
'yjit/**/*': [team:yjit]
'yjit/src/cruby_bindings.inc.rs': []
'doc/yjit/*': [team:yjit]
'bootstraptest/test_yjit*': [team:yjit]
'test/ruby/test_yjit*': [team:yjit]
options:
ignore_draft: true
# This currently doesn't work as intended. We want to skip reviews when only
# cruby_bingings.inc.rs is modified, but this skips reviews even when other
# yjit files are modified as well. To be enabled after fixing the behavior.
#last_files_match_only: true
8 changes: 5 additions & 3 deletions .github/workflows/annocheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ jobs:
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.labels.*.name, 'Documentation')
|| contains(github.event.pull_request.title, 'Document')
|| contains(github.event.pull_request.labels.*.name, 'Document')
|| (github.event_name == 'push' && github.actor == 'dependabot[bot]')
)}}
Expand All @@ -61,7 +63,7 @@ jobs:
- run: id
working-directory:

- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
sparse-checkout-cone-mode: false
sparse-checkout: /.github
Expand All @@ -72,7 +74,7 @@ jobs:
builddir: build
makeup: true

- uses: ruby/setup-ruby@d4526a55538b775af234ba4af27118ed6f8f6677 # v1.172.0
- uses: ruby/setup-ruby@70da3bbf44ac06db1b0547ce2acc9380a5270d1e # v1.175.0
with:
ruby-version: '3.0'
bundler: none
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/auto_request_review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Auto Request Review
on:
pull_request_target:
types: [opened, ready_for_review, reopened]

permissions:
contents: read

jobs:
auto-request-review:
name: Auto Request Review
runs-on: ubuntu-latest
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@e89da1a8cd7c8c16d9de9c6e763290b6b0e3d424 # v0.13.0
with:
# scope: public_repo
token: ${{ secrets.MATZBOT_GITHUB_TOKEN }}
8 changes: 5 additions & 3 deletions .github/workflows/baseruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ jobs:
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.labels.*.name, 'Documentation')
|| contains(github.event.pull_request.title, 'Document')
|| contains(github.event.pull_request.labels.*.name, 'Document')
|| (github.event_name == 'push' && github.actor == 'dependabot[bot]')
)}}
Expand All @@ -49,12 +51,12 @@ jobs:
- ruby-3.3

steps:
- uses: ruby/setup-ruby@d4526a55538b775af234ba4af27118ed6f8f6677 # v1.172.0
- uses: ruby/setup-ruby@70da3bbf44ac06db1b0547ce2acc9380a5270d1e # v1.175.0
with:
ruby-version: ${{ matrix.ruby }}
bundler: none

- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4

- uses: ./.github/actions/setup/ubuntu

Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/bundled_gems.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
token: ${{ (github.repository == 'ruby/ruby' && !startsWith(github.event_name, 'pull')) && secrets.MATZBOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}

Expand All @@ -56,6 +56,13 @@ jobs:
run: |
ruby -i~ tool/update-bundled_gems.rb gems/bundled_gems >> $GITHUB_OUTPUT
- name: Update spec/bundler/support/builders.rb
run: |
#!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: |
ruby tool/update-NEWS-gemlist.rb bundled
Expand All @@ -69,6 +76,7 @@ jobs:
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
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/check_dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,15 @@ jobs:
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.labels.*.name, 'Documentation')
|| 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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4

- uses: ./.github/actions/setup/ubuntu
if: ${{ contains(matrix.os, 'ubuntu') }}
Expand All @@ -53,7 +55,7 @@ jobs:

- uses: ./.github/actions/setup/directories

- uses: ruby/setup-ruby@d4526a55538b775af234ba4af27118ed6f8f6677 # v1.172.0
- uses: ruby/setup-ruby@70da3bbf44ac06db1b0547ce2acc9380a5270d1e # v1.175.0
with:
ruby-version: '3.0'
bundler: none
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
token: ${{ (github.repository == 'ruby/ruby' && !startsWith(github.event_name, 'pull')) && secrets.MATZBOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}

Expand Down
Loading

0 comments on commit 4dce609

Please sign in to comment.