Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into Ractor-Local-GC-v…
Browse files Browse the repository at this point in the history
…ersion-2
  • Loading branch information
rm155 committed Feb 28, 2024
2 parents d6d607c + 1cef366 commit fd05e55
Show file tree
Hide file tree
Showing 586 changed files with 8,509 additions and 2,252 deletions.
4 changes: 4 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ fc4acf8cae82e5196186d3278d831f2438479d91
# Make prism_compile.c indentation consistent
40b2c8e5e7e6e5f83cee9276dc9c1922a69292d6
d2c5867357ed88eccc28c2b3bd4a46e206e7ff85

# Miss-and-revived commits
a0f7de814ae5c299d6ce99bed5fb308a05d50ba0
d4e24021d39e1f80f0055b55d91f8d5f22e15084
33 changes: 33 additions & 0 deletions .github/actions/launchable/record-test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Record tests in Launchable
description: >-
Upload the test results to Launchable
inputs:
os:
required: true
description: An operating system that CI runs on. This value is used in Launchable flavor.

report-path:
default: launchable_reports.json
required: true
description: A file path of the test report for uploading to Launchable

test-opts:
default: none
required: false
description: >-
Test options that determine how tests are run.
This value is used in the Launchable flavor.
outputs: {} # nothing?

runs:
using: composite

steps:
- name: Launchable - record tests
working-directory: ${{ inputs.builddir }}
shell: bash
run: |
test_opts="$(echo ${{ inputs.test-opts }} | sed 's/=/:/g' | sed 's/ //g')"
launchable record tests --flavor os=${{ inputs.os }} --flavor test_task=${{ matrix.test_task }} --flavor test_opts=${test_opts} raw ${{ inputs.report-path }}
84 changes: 84 additions & 0 deletions .github/actions/launchable/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Set up Launchable
description: >-
Install the required dependencies and execute the necessary Launchable commands for test recording
inputs:
report-path:
default: launchable_reports.json
required: true
description: The file path of the test report for uploading to Launchable

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.
outputs:
enable-launchable:
description: "The boolean value indicating whether Launchable is enabled or not"
value: ${{ steps.enable-launchable.outputs.enable-launchable }}

runs:
using: composite

steps:
- name: Enable Launchable conditionally
id: enable-launchable
run: echo "enable-launchable=true" >> $GITHUB_OUTPUT
shell: bash
if: >-
${{
(github.repository == 'ruby/ruby' ||
(github.repository != 'ruby/ruby' && env.LAUNCHABLE_TOKEN)) &&
(matrix.test_task == 'check' || matrix.test_task == 'test-all')
}}
# Launchable CLI requires Python and Java.
# https://www.launchableinc.com/docs/resources/cli-reference/
- name: Set up Python
uses: actions/setup-python@871daa956ca9ea99f3c3e30acb424b7960676734 # v5.0.0
with:
python-version: "3.x"
if: steps.enable-launchable.outputs.enable-launchable

- name: Set up Java
uses: actions/setup-java@7a445ee88d4e23b52c33fdc7601e40278616c7f8 # v4.0.0
with:
distribution: 'temurin'
java-version: '17'
if: steps.enable-launchable.outputs.enable-launchable

- name: Set environment variables for Launchable
shell: bash
run: |
: # GITHUB_PULL_REQUEST_URL are used for commenting test reports in Launchable Github App.
: # https://github.com/launchableinc/cli/blob/v1.80.1/launchable/utils/link.py#L42
echo "GITHUB_PULL_REQUEST_URL=${{ github.event.pull_request.html_url }}" >> $GITHUB_ENV
: # The following envs are necessary in Launchable tokenless authentication.
: # https://github.com/launchableinc/cli/blob/v1.80.1/launchable/utils/authentication.py#L20
echo "LAUNCHABLE_ORGANIZATION=${{ github.repository_owner }}" >> $GITHUB_ENV
echo "LAUNCHABLE_WORKSPACE=${{ github.event.repository.name }}" >> $GITHUB_ENV
: # https://github.com/launchableinc/cli/blob/v1.80.1/launchable/utils/authentication.py#L71
echo "GITHUB_PR_HEAD_SHA=${{ github.event.pull_request.head.sha || github.sha }}" >> $GITHUB_ENV
echo "LAUNCHABLE_TOKEN=${{ inputs.launchable-token }}" >> $GITHUB_ENV
if: steps.enable-launchable.outputs.enable-launchable

- name: Set up Launchable
shell: bash
run: |
set -x
PATH=$PATH:$(python -msite --user-base)/bin
echo "PATH=$PATH" >> $GITHUB_ENV
pip install --user launchable
launchable verify
: # The build name cannot include a slash, so we replace the string here.
github_ref="$(echo ${{ github.ref }} | sed 's/\//_/g')"
: # 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.
: #
: # FIXME: Need to fix `WARNING: Failed to process a change to a file`.
: # https://github.com/launchableinc/cli/issues/786
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
15 changes: 7 additions & 8 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ jobs:
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: >-
${{github.repository == 'ruby/ruby' &&
!(false
${{!(false
|| contains(github.event.head_commit.message, '[DOC]')
|| contains(github.event.pull_request.title, '[DOC]')
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
Expand All @@ -58,14 +57,14 @@ jobs:
os: ubuntu-latest
# ruby analysis used large memory. We need to use a larger runner.
- language: ruby
os: macos-arm-oss
os: ${{ github.repository == 'ruby/ruby' && 'macos-arm-oss' || 'macos-14' }}

steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Install libraries
if: ${{ matrix.os == 'macos-arm-oss' }}
if: ${{ contains(matrix.os, 'macos') }}
uses: ./.github/actions/setup/macos

- name: Install libraries
Expand All @@ -79,15 +78,15 @@ jobs:
run: sudo rm /usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb

- name: Initialize CodeQL
uses: github/codeql-action/init@379614612a29c9e28f31f39a59013eb8012a51f0 # v3.24.3
uses: github/codeql-action/init@47b3d888fe66b639e431abf22ebca059152f1eea # v3.24.5
with:
languages: ${{ matrix.language }}

- name: Autobuild
uses: github/codeql-action/autobuild@379614612a29c9e28f31f39a59013eb8012a51f0 # v3.24.3
uses: github/codeql-action/autobuild@47b3d888fe66b639e431abf22ebca059152f1eea # v3.24.5

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@379614612a29c9e28f31f39a59013eb8012a51f0 # v3.24.3
uses: github/codeql-action/analyze@47b3d888fe66b639e431abf22ebca059152f1eea # v3.24.5
with:
category: '/language:${{ matrix.language }}'
upload: False
Expand Down Expand Up @@ -117,7 +116,7 @@ jobs:
continue-on-error: true

- name: Upload SARIF
uses: github/codeql-action/upload-sarif@379614612a29c9e28f31f39a59013eb8012a51f0 # v3.24.3
uses: github/codeql-action/upload-sarif@47b3d888fe66b639e431abf22ebca059152f1eea # v3.24.5
with:
sarif_file: sarif-results/${{ matrix.language }}.sarif
continue-on-error: true
40 changes: 33 additions & 7 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,17 @@ jobs:
strategy:
matrix:
test_task: ['check']
configure: ['']
os: ${{ fromJSON(format('["macos-12","macos-13"{0}]', (github.repository == 'ruby/ruby' && ',"macos-arm-oss"' || ''))) }}
test_opts: ['']
os:
- macos-12
- macos-13
- ${{ github.repository == 'ruby/ruby' && 'macos-arm-oss' || 'macos-14' }}
include:
- test_task: test-all TESTS=--repeat-count=2
os: ${{ github.repository == 'ruby/ruby' && 'macos-arm-oss' || 'macos-13' }}
- test_task: test-all
test_opts: --repeat-count=2
os: ${{ github.repository == 'ruby/ruby' && 'macos-arm-oss' || 'macos-14' }}
- test_task: test-bundled-gems
os: ${{ github.repository == 'ruby/ruby' && 'macos-arm-oss' || 'macos-13' }}
os: ${{ github.repository == 'ruby/ruby' && 'macos-arm-oss' || 'macos-14' }}
fail-fast: false

env:
Expand All @@ -52,6 +56,8 @@ jobs:
with:
sparse-checkout-cone-mode: false
sparse-checkout: /.github
# Set fetch-depth: 0 so that Launchable can receive commits information.
fetch-depth: 0

- name: Install libraries
uses: ./.github/actions/setup/macos
Expand All @@ -64,7 +70,7 @@ jobs:
dummy-files: ${{ matrix.test_task == 'check' }}

- name: Run configure
run: ../src/configure -C --disable-install-doc ${{ matrix.configure }}
run: ../src/configure -C --disable-install-doc

- run: make prepare-gems
if: ${{ matrix.test_task == 'test-bundled-gems' }}
Expand All @@ -78,6 +84,16 @@ jobs:
echo "TESTS=${TESTS}" >> $GITHUB_ENV
if: ${{ matrix.test_task == 'check' && matrix.skipped_tests }}

- name: Set up Launchable
id: enable-launchable
uses: ./.github/actions/launchable/setup
with:
launchable-token: ${{ secrets.LAUNCHABLE_TOKEN }}

- name: Set extra test options
run: echo "TESTS=$TESTS ${{ matrix.test_opts }}" >> $GITHUB_ENV
if: matrix.test_opts

- name: make ${{ matrix.test_task }}
run: |
make -s ${{ matrix.test_task }} ${TESTS:+TESTS="$TESTS"}
Expand All @@ -97,9 +113,19 @@ jobs:
if: ${{ matrix.test_task == 'check' && matrix.skipped_tests }}
continue-on-error: ${{ matrix.continue-on-skipped_tests || false }}

- name: Record test results in Launchable
uses: ./.github/actions/launchable/record-test
with:
# We need to configure the `build` directory because
# this composite action is executed in the default working directory.
report-path: build/launchable_reports.json
os: ${{ matrix.os }}
test-opts: ${{ matrix.test_opts }}
if: ${{ always() && steps.enable-launchable.outputs.enable-launchable }}

- uses: ./.github/actions/slack
with:
label: ${{ matrix.os }} / ${{ matrix.test_task }} ${{ matrix.configure }}
label: ${{ matrix.os }} / ${{ matrix.test_task }}
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
if: ${{ failure() }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: 'Upload to code-scanning'
uses: github/codeql-action/upload-sarif@379614612a29c9e28f31f39a59013eb8012a51f0 # v2.1.27
uses: github/codeql-action/upload-sarif@47b3d888fe66b639e431abf22ebca059152f1eea # v2.1.27
with:
sarif_file: results.sarif
16 changes: 16 additions & 0 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ jobs:
echo "TESTS=${TESTS}" >> $GITHUB_ENV
if: ${{ matrix.test_task == 'check' && matrix.skipped_tests }}

- name: Set up Launchable
id: enable-launchable
uses: ./.github/actions/launchable/setup
with:
launchable-token: ${{ secrets.LAUNCHABLE_TOKEN }}

- name: make ${{ matrix.test_task }}
run: >-
$SETARCH make -s ${{ matrix.test_task }}
Expand All @@ -115,6 +121,16 @@ jobs:
if: ${{ matrix.test_task == 'check' && matrix.skipped_tests }}
continue-on-error: ${{ matrix.continue-on-skipped_tests || false }}

- name: Record test results in Launchable
uses: ./.github/actions/launchable/record-test
with:
# We need to configure the `build` directory because
# this composite action is executed in the default working directory.
report-path: build/launchable_reports.json
os: ubuntu-20.04
test-opts: ${{ matrix.configure }}
if: ${{ always() && steps.enable-launchable.outputs.enable-launchable }}

- uses: ./.github/actions/slack
with:
label: ${{ matrix.test_task }} ${{ matrix.configure }}${{ matrix.arch }}
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/yjit-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ jobs:
cargo:
name: cargo test

runs-on: macos-arm-oss
runs-on: ${{ github.repository == 'ruby/ruby' && 'macos-arm-oss' || 'macos-14' }}

if: >-
${{github.repository == 'ruby/ruby' &&
!(false
${{!(false
|| contains(github.event.head_commit.message, '[DOC]')
|| contains(github.event.pull_request.title, '[DOC]')
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
Expand Down Expand Up @@ -65,11 +64,10 @@ jobs:
GITPULLOPTIONS: --no-tags origin ${{ github.ref }}
RUN_OPTS: ${{ matrix.yjit_opts }}

runs-on: macos-arm-oss
runs-on: ${{ github.repository == 'ruby/ruby' && 'macos-arm-oss' || 'macos-14' }}

if: >-
${{github.repository == 'ruby/ruby' &&
!(false
${{!(false
|| contains(github.event.head_commit.message, '[DOC]')
|| contains(github.event.pull_request.title, '[DOC]')
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
Expand Down Expand Up @@ -137,9 +135,9 @@ jobs:
if: ${{ failure() }}

result:
if: ${{ always() && github.repository == 'ruby/ruby' }}
if: ${{ always() }}
name: ${{ github.workflow }} result
runs-on: macos-arm-oss
runs-on: ${{ github.repository == 'ruby/ruby' && 'macos-arm-oss' || 'macos-14' }}
needs: [make]
steps:
- run: exit 1
Expand Down
Loading

0 comments on commit fd05e55

Please sign in to comment.