diff --git a/.github/actions/compilers/action.yml b/.github/actions/compilers/action.yml index 3a056af05418b0..68b178e52f1d99 100644 --- a/.github/actions/compilers/action.yml +++ b/.github/actions/compilers/action.yml @@ -71,6 +71,18 @@ inputs: description: >- whitespace separated list of extensions that need be linked statically. + 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. + + launchable-url: + 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. + runs: using: composite steps: @@ -79,7 +91,7 @@ runs: - name: Enable Launchable conditionally id: enable-launchable - run: echo "enable-launchable=false" >> $GITHUB_OUTPUT + run: echo "enable-launchable=true" >> $GITHUB_OUTPUT shell: bash if: >- ${{ @@ -122,4 +134,6 @@ runs: --env GITHUB_EVENT_NAME --env GITHUB_SHA --env GITHUB_HEAD_REF + --env LAUNCHABLE_TOKEN='${{ secrets.LAUNCHABLE_TOKEN }}' + --env LAUNCHABLE_BASE_URL='${{ secrets.LAUNCHABLE_BASE_URL }}' 'ghcr.io/ruby/ruby-ci-image:${{ inputs.tag }}' diff --git a/.github/actions/launchable/setup/action.yml b/.github/actions/launchable/setup/action.yml index 2d92cb7d9967c1..4a11e37898cf34 100644 --- a/.github/actions/launchable/setup/action.yml +++ b/.github/actions/launchable/setup/action.yml @@ -3,11 +3,6 @@ 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 - os: required: true description: The operating system that CI runs on. This value is used in Launchable flavor. @@ -24,6 +19,12 @@ inputs: 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. + + launchable-url: + 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 @@ -38,18 +39,21 @@ inputs: Directory to (re-)checkout source codes. Launchable retrieves the commit information from the directory. - launchable-workspace: - required: true - default: ${{ github.event.repository.name }} - description: >- - A workspace name in Launchable - test-task: - required: true + required: false default: ${{ matrix.test_task }} description: >- - A test task that determine which tests are executed. + Specifies a single test task to be executed. This value is used in the Launchable flavor. + Either 'test-task' or 'multi-test-tasks' must be configured. + + test-tasks: + required: false + default: '[]' + description: >- + Specifies an array of multiple test tasks to be executed. + For example: '["test", "test-all"]'. + If you want to run a single test task, use the 'test-task' input instead. runs: using: composite @@ -61,11 +65,11 @@ runs: shell: bash if: >- ${{ - (github.repository == 'ruby/ruby' || - (github.repository != 'ruby/ruby' && env.LAUNCHABLE_TOKEN)) && - (inputs.test-task == 'check' || - inputs.test-task == 'test-all' || - inputs.test-task == 'test') + (inputs.test-task == 'check' + || inputs.test-task == 'test-all' + || inputs.test-task == 'test' + || contains(fromJSON(inputs.test-tasks), 'test-all') + || contains(fromJSON(inputs.test-tasks), 'test')) }} # Launchable CLI requires Python and Java. @@ -83,6 +87,16 @@ runs: java-version: '17' if: steps.enable-launchable.outputs.enable-launchable + - name: Check test-task + id: test-task + shell: bash + run: | + test_all_enabled="${{ inputs.test-task == 'check' || inputs.test-task == 'test-all' || contains(fromJSON(inputs.test-tasks), 'test-all') }}" + btest_enabled="${{ inputs.test-task == 'check' || inputs.test-task == 'test' || contains(fromJSON(inputs.test-tasks), 'test') }}" + echo test_all_enabled="${test_all_enabled}" >> $GITHUB_OUTPUT + echo btest_enabled="${btest_enabled}" >> $GITHUB_OUTPUT + if: steps.enable-launchable.outputs.enable-launchable + - name: Set environment variables for Launchable shell: bash run: | @@ -92,10 +106,11 @@ runs: : # 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=${{ inputs.launchable-workspace }}" >> $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 + echo "LAUNCHABLE_BASE_URL=${{ inputs.launchable-url }}" >> $GITHUB_ENV if: steps.enable-launchable.outputs.enable-launchable - name: Set up path @@ -122,8 +137,16 @@ runs: : # 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 [ "${test_all_enabled}" = "true" ]; then + echo "TESTS=${TESTS} --launchable-test-reports=launchable_test_all.json" >> $GITHUB_ENV + fi + if [ "${btest_enabled}" = "true" ]; then + echo "BTESTS=${BTESTS} --launchable-test-reports=launchable_bootstraptest.json" >> $GITHUB_ENV + fi if: steps.enable-launchable.outputs.enable-launchable + env: + test_all_enabled: ${{ steps.test-task.outputs.test_all_enabled }} + btest_enabled: ${{ steps.test-task.outputs.btest_enabled }} - name: Variables to report Launchable id: variables @@ -142,13 +165,20 @@ runs: # 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 [ "${test_all_enabled}" = "true" ]; then + test_report_path="${dir}${builddir:+${builddir}/}launchable_test_all.json" + echo test_report_path="${test_report_path}" >> $GITHUB_OUTPUT + fi + if [ "${btest_enabled}" = "true" ]; then + boot_report_path="${dir}${builddir:+${builddir}/}launchable_bootstraptest.json" + echo boot_report_path="${boot_report_path}" >> $GITHUB_OUTPUT + fi if: steps.enable-launchable.outputs.enable-launchable env: srcdir: ${{ inputs.srcdir }} builddir: ${{ inputs.builddir }} - report_path: ${{ inputs.report-path }} + test_all_enabled: ${{ steps.test-task.outputs.test_all_enabled }} + btest_enabled: ${{ steps.test-task.outputs.btest_enabled }} - name: Record test results in Launchable uses: gacts/run-and-post-run@674528335da98a7afc80915ff2b4b860a0b3553a # v1.4.0 @@ -156,10 +186,28 @@ runs: shell: bash working-directory: ${{ inputs.srcdir }} post: | - : # record - launchable record tests --flavor os=${{ inputs.os }} --flavor test_task=${{ inputs.test-task }} --flavor test_opts=${test_opts} raw ${report_path} - rm -f ${report_path} + [[ "${test_all_enabled}" = "true" ]] && \ + launchable record tests \ + --flavor os=${{ inputs.os }} \ + --flavor test_task=${{ inputs.test-task }} \ + --flavor test_opts=${test_opts} \ + --test-suite test-all \ + raw ${test_report_path} || true + + [[ "${btest_enabled}" = "true" ]] && \ + launchable record tests \ + --flavor os=${{ inputs.os }} \ + --flavor test_task=${{ inputs.test-task }} \ + --flavor test_opts=${test_opts} \ + --test-suite bootstraptest \ + raw ${boot_report_path} || true + + rm -f ${test_report_path} + rm -f ${boot_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 }} + test_report_path: ${{ steps.variables.outputs.test_report_path }} + boot_report_path: ${{ steps.variables.outputs.boot_report_path }} + test_all_enabled: ${{ steps.test-task.outputs.test_all_enabled }} + btest_enabled: ${{ steps.test-task.outputs.btest_enabled }} diff --git a/.github/workflows/annocheck.yml b/.github/workflows/annocheck.yml deleted file mode 100644 index 8cc482c428dd8e..00000000000000 --- a/.github/workflows/annocheck.yml +++ /dev/null @@ -1,112 +0,0 @@ -name: Annocheck - -on: - push: - paths-ignore: - - 'doc/**' - - '**/man/*' - - '**.md' - - '**.rdoc' - - '**/.document' - - '.*.yml' - pull_request: - paths-ignore: - - 'doc/**' - - '**/man/*' - - '**.md' - - '**.rdoc' - - '**/.document' - - '.*.yml' - merge_group: - -concurrency: - group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} - cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} - -permissions: - contents: read - -jobs: - compile: - name: test-annocheck - - runs-on: ubuntu-latest - - container: - image: ghcr.io/ruby/ruby-ci-image:gcc-11 - options: --user root - - 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.title, 'Document') - || contains(github.event.pull_request.labels.*.name, 'Documentation') - || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') - )}} - - env: - CONFIGURE_TTY: never - GITPULLOPTIONS: --no-tags origin ${{ github.ref }} - RUBY_DEBUG: ci rgengc - RUBY_TESTOPTS: >- - -q - --color=always - --tty=no - # FIXME: Drop skipping options - # https://bugs.ruby-lang.org/issues/18061 - # https://sourceware.org/annobin/annobin.html/Test-pie.html - TEST_ANNOCHECK_OPTS: '--skip-pie --skip-gaps' - - steps: - - run: id - working-directory: - - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - with: - sparse-checkout-cone-mode: false - sparse-checkout: /.github - - - uses: ./.github/actions/setup/directories - with: - srcdir: src - builddir: build - makeup: true - - - uses: ruby/setup-ruby@a6e6f86333f0a2523ece813039b8b4be04560854 # v1.190.0 - with: - ruby-version: '3.0' - bundler: none - - # Minimal flags to pass the check. - # -g0 disables backtraces when SEGV. Do not set that. - - name: Run configure - run: > - ../src/configure -C - --enable-debug-env - --disable-install-doc - --with-ext=-test-/cxxanyargs,+ - --without-valgrind - --without-jemalloc - --without-gmp - --with-gcc="gcc-11 -fcf-protection -Wa,--generate-missing-build-notes=yes" - --enable-shared - debugflags=-ggdb3 - optflags=-O2 - LDFLAGS=-Wl,-z,now - - - run: make showflags - - - run: make - - - run: make test-annocheck - - - uses: ./.github/actions/slack - with: - SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot - if: ${{ failure() }} - -defaults: - run: - working-directory: build diff --git a/.github/workflows/auto_request_review.yml b/.github/workflows/auto_request_review.yml deleted file mode 100644 index ca27244b46547b..00000000000000 --- a/.github/workflows/auto_request_review.yml +++ /dev/null @@ -1,19 +0,0 @@ -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 }} diff --git a/.github/workflows/baseruby.yml b/.github/workflows/baseruby.yml deleted file mode 100644 index 3dbf135736a4d8..00000000000000 --- a/.github/workflows/baseruby.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: BASERUBY Check - -on: - push: - paths-ignore: - - 'doc/**' - - '**/man/*' - - '**.md' - - '**.rdoc' - - '**/.document' - - '.*.yml' - pull_request: - paths-ignore: - - 'doc/**' - - '**/man/*' - - '**.md' - - '**.rdoc' - - '**/.document' - - '.*.yml' - merge_group: - -concurrency: - group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} - cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} - -permissions: - contents: read - -jobs: - baseruby: - name: BASERUBY - - runs-on: ubuntu-20.04 - - 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.title, 'Document') - || contains(github.event.pull_request.labels.*.name, 'Documentation') - || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') - )}} - - strategy: - matrix: - ruby: - - ruby-3.0 - - ruby-3.1 - - ruby-3.2 - - ruby-3.3 - - steps: - - uses: ruby/setup-ruby@a6e6f86333f0a2523ece813039b8b4be04560854 # v1.190.0 - with: - ruby-version: ${{ matrix.ruby }} - bundler: none - - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - - uses: ./.github/actions/setup/ubuntu - - - uses: ./.github/actions/setup/directories - with: - makeup: true - - - run: ./configure --disable-install-doc - - - run: make all - - - run: make test - - - uses: ./.github/actions/slack - with: - label: ${{ matrix.ruby }} - SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot - if: ${{ failure() }} diff --git a/.github/workflows/bundled_gems.yml b/.github/workflows/bundled_gems.yml deleted file mode 100644 index da2c7028c2e00c..00000000000000 --- a/.github/workflows/bundled_gems.yml +++ /dev/null @@ -1,136 +0,0 @@ -name: bundled_gems - -on: - push: - branches: ['master'] - paths: - - '.github/workflows/bundled_gems.yml' - - 'gems/bundled_gems' - pull_request: - branches: ['master'] - paths: - - '.github/workflows/bundled_gems.yml' - - 'gems/bundled_gems' - merge_group: - schedule: - - cron: '45 6 * * *' - workflow_dispatch: - -permissions: # added using https://github.com/step-security/secure-workflows - contents: read - -jobs: - update: - permissions: - contents: write # for Git to git push - - if: ${{ github.event_name != 'schedule' || github.repository == 'ruby/ruby' }} - - name: update ${{ github.workflow }} - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - with: - token: ${{ (github.repository == 'ruby/ruby' && !startsWith(github.event_name, 'pull')) && secrets.MATZBOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - - - uses: ./.github/actions/setup/directories - with: - # Skip overwriting MATZBOT_GITHUB_TOKEN - checkout: '' # false (ref: https://github.com/actions/runner/issues/2238) - - - name: Set ENV - run: | - echo "TODAY=$(date +%F)" >> $GITHUB_ENV - - - name: Download previous gems list - run: | - mkdir -p .downloaded-cache - for data in bundled_gems.json default_gems.json; do - ln -s .downloaded-cache/$data . - curl -O -R -z ./$data https://stdgems.org/$data - done - - - name: Update bundled gems list - id: bundled_gems - 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 - - - name: Check diffs - id: diff - run: | - news= gems= - git diff --color --no-ext-diff --ignore-submodules --exit-code -- NEWS.md || - news=true - 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 - - - name: Install libraries - uses: ./.github/actions/setup/ubuntu - if: ${{ steps.diff.outputs.gems }} - - - name: Build - run: | - ./autogen.sh - ./configure -C --disable-install-doc - make - if: ${{ steps.diff.outputs.gems }} - - - name: Prepare bundled gems - run: | - make -s prepare-gems - if: ${{ steps.diff.outputs.gems }} - - - name: Test bundled gems - run: | - make -s test-bundled-gems - timeout-minutes: 30 - env: - RUBY_TESTOPTS: '-q --tty=no' - TEST_BUNDLED_GEMS_ALLOW_FAILURES: 'typeprof' - if: ${{ steps.diff.outputs.gems }} - - - name: Commit - run: | - git pull --ff-only origin ${GITHUB_REF#refs/heads/} - message="Update bundled gems list" - if [ -z "${gems}" ]; then - git commit --message="${message} at ${GITHUB_SHA:0:30} [ci skip]" - else - git commit --message="${message} as of ${TODAY}" - fi - git push origin ${GITHUB_REF#refs/heads/} - env: - TODAY: ${{ steps.bundled_gems.outputs.latest_date || env.TODAY }} - EMAIL: svn-admin@ruby-lang.org - GIT_AUTHOR_NAME: git - GIT_COMMITTER_NAME: git - gems: ${{ steps.diff.outputs.gems }} - if: >- - ${{ - github.repository == 'ruby/ruby' && - !startsWith(github.event_name, 'pull') && - steps.diff.outputs.update - }} - - - uses: ./.github/actions/slack - with: - SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot - if: ${{ failure() }} diff --git a/.github/workflows/check_dependencies.yml b/.github/workflows/check_dependencies.yml deleted file mode 100644 index d871ef02c00958..00000000000000 --- a/.github/workflows/check_dependencies.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: Check Dependencies -on: - push: - paths-ignore: - - 'doc/**' - - '**/man/*' - - '**.md' - - '**.rdoc' - - '**/.document' - - '.*.yml' - pull_request: - merge_group: - -concurrency: - group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} - cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} - -permissions: - contents: read - -jobs: - update-deps: - name: Dependency checks - - strategy: - matrix: - os: [ubuntu-latest] - fail-fast: true - - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - - uses: ./.github/actions/setup/ubuntu - if: ${{ contains(matrix.os, 'ubuntu') }} - - - uses: ./.github/actions/setup/macos - if: ${{ contains(matrix.os, 'macos') }} - - - uses: ./.github/actions/setup/directories - - - uses: ruby/setup-ruby@a6e6f86333f0a2523ece813039b8b4be04560854 # v1.190.0 - with: - ruby-version: '3.0' - bundler: none - - - name: Run configure - run: ./configure -C --disable-install-doc --disable-rubygems --with-gcc 'optflags=-O0' 'debugflags=-save-temps=obj -g' - - - run: make all golf - - - run: ./goruby -veh - - - run: ruby tool/update-deps --fix - - - run: git diff --no-ext-diff --ignore-submodules --exit-code - - - uses: ./.github/actions/slack - with: - label: ${{ matrix.os }} / Dependencies need to update - SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot - if: ${{ failure() }} diff --git a/.github/workflows/check_misc.yml b/.github/workflows/check_misc.yml deleted file mode 100644 index 5c6a95a05d5caf..00000000000000 --- a/.github/workflows/check_misc.yml +++ /dev/null @@ -1,140 +0,0 @@ -name: Misc -on: [push, pull_request, merge_group] - -concurrency: - group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} - cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} - -permissions: - contents: read - -jobs: - checks: - name: Miscellaneous checks - - permissions: - contents: write # for Git to git push - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - with: - token: ${{ (github.repository == 'ruby/ruby' && !startsWith(github.event_name, 'pull')) && secrets.MATZBOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - - - uses: ./.github/actions/setup/directories - with: - makeup: true - # Skip overwriting MATZBOT_GITHUB_TOKEN - checkout: '' # false (ref: https://github.com/actions/runner/issues/2238) - - - name: Check if C-sources are US-ASCII - run: | - grep -r -n --include='*.[chyS]' --include='*.asm' $'[^\t-~]' -- . && exit 1 || : - - - name: Check for trailing spaces - run: | - git grep -I -n $'[\t ]$' -- '*.rb' '*.[chy]' '*.rs' '*.yml' && exit 1 || : - git grep -n $'^[\t ][\t ]*$' -- '*.md' && exit 1 || : - - - name: Check for bash specific substitution in configure.ac - run: | - git grep -n '\${[A-Za-z_0-9]*/' -- configure.ac && exit 1 || : - - - name: Check for header macros - run: | - fail= - for header in ruby/*.h; do - git grep -l -F -e $header -e HAVE_`echo $header | tr a-z./ A-Z__` -- . > /dev/null && continue - fail=1 - echo $header - done - exit $fail - working-directory: include - - - id: gems - run: true - if: ${{ github.ref == 'refs/heads/master' }} - - - name: Download previous gems list - run: | - data=default_gems.json - mkdir -p .downloaded-cache - ln -s .downloaded-cache/$data . - curl -O -R -z ./$data https://stdgems.org/$data - if: ${{ steps.gems.outcome == 'success' }} - - - name: Make default gems list - run: | - #!ruby - require 'rubygems' - $:.unshift "lib" - rgver = File.foreach("lib/rubygems.rb") do |line| - break $1 if /^\s*VERSION\s*=\s*"([^"]+)"/ =~ line - end - gems = Dir.glob("{ext,lib}/**/*.gemspec").map do |f| - spec = Gem::Specification.load(f) - "#{spec.name} #{spec.version}" - end.sort - File.open("gems/default_gems", "w") do |f| - f.puts "RubyGems #{rgver}" - f.puts gems - end - shell: ruby --disable=gems {0} - if: ${{ steps.gems.outcome == 'success' }} - - - name: Maintain updated gems list in NEWS - run: | - ruby tool/update-NEWS-gemlist.rb default - if: ${{ steps.gems.outcome == 'success' }} - - - name: Check diffs - id: diff - run: | - git diff --color --no-ext-diff --ignore-submodules --exit-code NEWS.md || - echo update=true >> $GITHUB_OUTPUT - if: ${{ steps.gems.outcome == 'success' }} - - - name: Commit - run: | - git pull --ff-only origin ${GITHUB_REF#refs/heads/} - git commit --message="Update default gems list at ${GITHUB_SHA:0:30} [ci skip]" NEWS.md - git push origin ${GITHUB_REF#refs/heads/} - env: - EMAIL: svn-admin@ruby-lang.org - GIT_AUTHOR_NAME: git - GIT_COMMITTER_NAME: git - if: >- - ${{ - github.repository == 'ruby/ruby' && - !startsWith(github.event_name, 'pull') && - steps.diff.outputs.update - }} - - - name: Generate docs - id: docs - run: | - ruby -W0 --disable-gems -I./lib tool/rdoc-srcdir -q --op html . - echo htmlout=ruby-html-${GITHUB_SHA:0:10} >> $GITHUB_OUTPUT - # Generate only when document commit/PR - if: >- - ${{false - || contains(github.event.head_commit.message, '[ruby/rdoc]') - || 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.title, 'Document') - || contains(github.event.pull_request.labels.*.name, 'Documentation') - }} - - - name: Upload docs - uses: actions/upload-artifact@v4 - with: - path: html - name: ${{ steps.docs.outputs.htmlout }} - if: ${{ steps.docs.outcome == 'success' }} - - - uses: ./.github/actions/slack - with: - SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot - if: ${{ failure() }} diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 2fb8e72391513a..00000000000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,121 +0,0 @@ -name: 'CodeQL' - -on: - push: - branches: ['master'] - paths-ignore: - - 'doc/**' - - '**/man/*' - - '**.md' - - '**.rdoc' - - '**/.document' - - '.*.yml' - pull_request: - paths-ignore: - - 'doc/**' - - '**/man/*' - - '**.md' - - '**.rdoc' - - '**/.document' - - '.*.yml' - schedule: - - cron: '0 12 * * *' - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} - cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} - -permissions: # added using https://github.com/step-security/secure-workflows - contents: read - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read # for github/codeql-action/init to get workflow details - contents: read # for actions/checkout to fetch code - 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: >- - ${{!(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.title, 'Document') - || contains(github.event.pull_request.labels.*.name, 'Documentation') - || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') - )}} - - env: - enable_install_doc: no - - strategy: - fail-fast: false - matrix: - include: - - language: cpp - - language: ruby - - steps: - - name: Checkout repository - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - - name: Install libraries - if: ${{ contains(matrix.os, 'macos') }} - uses: ./.github/actions/setup/macos - - - name: Install libraries - if : ${{ matrix.os == 'ubuntu-latest' }} - uses: ./.github/actions/setup/ubuntu - - - uses: ./.github/actions/setup/directories - - - name: Remove an obsolete rubygems vendored file - if: ${{ matrix.os == 'ubuntu-latest' }} - run: sudo rm /usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb - - - name: Initialize CodeQL - uses: github/codeql-action/init@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6 - with: - languages: ${{ matrix.language }} - - - name: Autobuild - uses: github/codeql-action/autobuild@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6 - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6 - with: - category: '/language:${{ matrix.language }}' - upload: False - output: sarif-results - - - name: filter-sarif - uses: advanced-security/filter-sarif@f3b8118a9349d88f7b1c0c488476411145b6270d # v1.0.1 - with: - patterns: | - +**/*.rb - -lib/uri/mailto.rb:rb/overly-large-range - -lib/uri/rfc3986_parser.rb:rb/overly-large-range - -lib/bundler/vendor/uri/lib/uri/mailto.rb:rb/overly-large-range - -lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb:rb/overly-large-range - -test/ruby/test_io.rb:rb/non-constant-kernel-open - -test/open-uri/test_open-uri.rb:rb/non-constant-kernel-open - -test/open-uri/test_ssl.rb:rb/non-constant-kernel-open - -spec/ruby/core/io/binread_spec.rb:rb/non-constant-kernel-open - -spec/ruby/core/io/readlines_spec.rb:rb/non-constant-kernel-open - -spec/ruby/core/io/foreach_spec.rb:rb/non-constant-kernel-open - -spec/ruby/core/io/write_spec.rb:rb/non-constant-kernel-open - -spec/ruby/core/io/read_spec.rb:rb/non-constant-kernel-open - -spec/ruby/core/kernel/open_spec.rb:rb/non-constant-kernel-open - input: sarif-results/${{ matrix.language }}.sarif - output: sarif-results/${{ matrix.language }}.sarif - if: ${{ matrix.language == 'ruby' }} - continue-on-error: true - - - name: Upload SARIF - uses: github/codeql-action/upload-sarif@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6 - with: - sarif_file: sarif-results/${{ matrix.language }}.sarif - continue-on-error: true diff --git a/.github/workflows/compilers.yml b/.github/workflows/compilers.yml index d8fcfc26385cd4..989717b8eca2d2 100644 --- a/.github/workflows/compilers.yml +++ b/.github/workflows/compilers.yml @@ -54,17 +54,44 @@ jobs: steps: - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 with: { sparse-checkout-cone-mode: false, sparse-checkout: /.github } - # Set fetch-depth: 10 so that Launchable can receive commits information. - { uses: './.github/actions/setup/directories', with: { srcdir: 'src', builddir: 'build', makeup: true, fetch-depth: 10 } } - - name: 'clang 18 LTO' + - name: 'GCC 13 LTO' uses: './.github/actions/compilers' with: - tag: clang-18 - with_gcc: 'clang-18 -flto=auto' + tag: gcc-13 + with_gcc: 'gcc-13 -flto=auto -ffat-lto-objects -Werror=lto-type-mismatch' optflags: '-O2' enable_shared: false - - { uses: './.github/actions/compilers', name: '-O0', with: { optflags: '-O0 -march=x86-64 -mtune=generic' } } - # - { uses: './.github/actions/compilers', name: '-O3', with: { optflags: '-O3 -march=x86-64 -mtune=generic', check: true } } + - uses: './.github/actions/compilers' + name: 'ext/Setup' + with: + static_exts: 'etc json/* */escape' + launchable-token: ${{ secrets.LAUNCHABLE_TOKEN }} + launchable-url: ${{ secrets.LAUNCHABLE_BASE_URL }} + - uses: './.github/actions/compilers' + name: 'GCC 14' + with: { tag: 'gcc-14' } + - uses: './.github/actions/compilers' + name: 'GCC 13' + with: { tag: 'gcc-13' } + - uses: './.github/actions/compilers' + name: 'GCC 12' + with: { tag: 'gcc-12' } + - uses: './.github/actions/compilers' + name: 'GCC 11' + with: { tag: 'gcc-11' } + - uses: './.github/actions/compilers' + name: 'GCC 10' + with: { tag: 'gcc-10' } + - uses: './.github/actions/compilers' + name: 'GCC 9' + with: { tag: 'gcc-9' } + - uses: './.github/actions/compilers' + name: 'GCC 8' + with: { tag: 'gcc-8' } + - uses: './.github/actions/compilers' + name: 'GCC 7' + with: { tag: 'gcc-7' } compile2: name: 'omnibus compilations, #2' @@ -83,15 +110,36 @@ jobs: with_gcc: 'gcc-13 -flto=auto -ffat-lto-objects -Werror=lto-type-mismatch' optflags: '-O2' enable_shared: false - - { uses: './.github/actions/compilers', name: 'ext/Setup', with: { static_exts: 'etc json/* */escape' } } - - { uses: './.github/actions/compilers', name: 'GCC 14', with: { tag: 'gcc-14' } } - - { uses: './.github/actions/compilers', name: 'GCC 13', with: { tag: 'gcc-13' } } - - { uses: './.github/actions/compilers', name: 'GCC 12', with: { tag: 'gcc-12' } } - - { uses: './.github/actions/compilers', name: 'GCC 11', with: { tag: 'gcc-11' } } - - { uses: './.github/actions/compilers', name: 'GCC 10', with: { tag: 'gcc-10' } } - - { uses: './.github/actions/compilers', name: 'GCC 9', with: { tag: 'gcc-9' } } - - { uses: './.github/actions/compilers', name: 'GCC 8', with: { tag: 'gcc-8' } } - - { uses: './.github/actions/compilers', name: 'GCC 7', with: { tag: 'gcc-7' } } + - uses: './.github/actions/compilers' + name: 'ext/Setup' + with: + static_exts: 'etc json/* */escape' + launchable-token: ${{ secrets.LAUNCHABLE_TOKEN }} + launchable-url: ${{ secrets.LAUNCHABLE_BASE_URL }} + - uses: './.github/actions/compilers' + name: 'GCC 14' + with: { tag: 'gcc-14' } + - uses: './.github/actions/compilers' + name: 'GCC 13' + with: { tag: 'gcc-13' } + - uses: './.github/actions/compilers' + name: 'GCC 12' + with: { tag: 'gcc-12' } + - uses: './.github/actions/compilers' + name: 'GCC 11' + with: { tag: 'gcc-11' } + - uses: './.github/actions/compilers' + name: 'GCC 10' + with: { tag: 'gcc-10' } + - uses: './.github/actions/compilers' + name: 'GCC 9' + with: { tag: 'gcc-9' } + - uses: './.github/actions/compilers' + name: 'GCC 8' + with: { tag: 'gcc-8' } + - uses: './.github/actions/compilers' + name: 'GCC 7' + with: { tag: 'gcc-7' } compile3: name: 'omnibus compilations, #3' @@ -103,13 +151,43 @@ jobs: - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 with: { sparse-checkout-cone-mode: false, sparse-checkout: /.github } - { uses: './.github/actions/setup/directories', with: { srcdir: 'src', builddir: 'build', makeup: true, fetch-depth: 10 } } - - { uses: './.github/actions/compilers', name: 'clang 20', with: { tag: 'clang-20' } } - - { uses: './.github/actions/compilers', name: 'clang 19', with: { tag: 'clang-19' } } - - { uses: './.github/actions/compilers', name: 'clang 18', with: { tag: 'clang-18' } } - - { uses: './.github/actions/compilers', name: 'clang 17', with: { tag: 'clang-17' } } - - { uses: './.github/actions/compilers', name: 'clang 16', with: { tag: 'clang-16' } } - - { uses: './.github/actions/compilers', name: 'clang 15', with: { tag: 'clang-15' } } - - { uses: './.github/actions/compilers', name: 'clang 14', with: { tag: 'clang-14' } } + - name: 'GCC 13 LTO' + uses: './.github/actions/compilers' + with: + tag: gcc-13 + with_gcc: 'gcc-13 -flto=auto -ffat-lto-objects -Werror=lto-type-mismatch' + optflags: '-O2' + enable_shared: false + - uses: './.github/actions/compilers' + name: 'ext/Setup' + with: + static_exts: 'etc json/* */escape' + launchable-token: ${{ secrets.LAUNCHABLE_TOKEN }} + launchable-url: ${{ secrets.LAUNCHABLE_BASE_URL }} + - uses: './.github/actions/compilers' + name: 'GCC 14' + with: { tag: 'gcc-14' } + - uses: './.github/actions/compilers' + name: 'GCC 13' + with: { tag: 'gcc-13' } + - uses: './.github/actions/compilers' + name: 'GCC 12' + with: { tag: 'gcc-12' } + - uses: './.github/actions/compilers' + name: 'GCC 11' + with: { tag: 'gcc-11' } + - uses: './.github/actions/compilers' + name: 'GCC 10' + with: { tag: 'gcc-10' } + - uses: './.github/actions/compilers' + name: 'GCC 9' + with: { tag: 'gcc-9' } + - uses: './.github/actions/compilers' + name: 'GCC 8' + with: { tag: 'gcc-8' } + - uses: './.github/actions/compilers' + name: 'GCC 7' + with: { tag: 'gcc-7' } compile4: name: 'omnibus compilations, #4' @@ -121,15 +199,43 @@ jobs: - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 with: { sparse-checkout-cone-mode: false, sparse-checkout: /.github } - { uses: './.github/actions/setup/directories', with: { srcdir: 'src', builddir: 'build', makeup: true, fetch-depth: 10 } } - - { uses: './.github/actions/compilers', name: 'clang 13', with: { tag: 'clang-13' } } - - { uses: './.github/actions/compilers', name: 'clang 12', with: { tag: 'clang-12' } } - - { uses: './.github/actions/compilers', name: 'clang 11', with: { tag: 'clang-11' } } - - { uses: './.github/actions/compilers', name: 'clang 10', with: { tag: 'clang-10' } } - # llvm-objcopy<=9 doesn't have --wildcard. It compiles, but leaves Rust symbols in libyjit.o. - - { uses: './.github/actions/compilers', name: 'clang 9', with: { tag: 'clang-9', append_configure: '--disable-yjit' } } - - { uses: './.github/actions/compilers', name: 'clang 8', with: { tag: 'clang-8', append_configure: '--disable-yjit' } } - - { uses: './.github/actions/compilers', name: 'clang 7', with: { tag: 'clang-7', append_configure: '--disable-yjit' } } - - { uses: './.github/actions/compilers', name: 'clang 6', with: { tag: 'clang-6.0', append_configure: '--disable-yjit' } } + - name: 'GCC 13 LTO' + uses: './.github/actions/compilers' + with: + tag: gcc-13 + with_gcc: 'gcc-13 -flto=auto -ffat-lto-objects -Werror=lto-type-mismatch' + optflags: '-O2' + enable_shared: false + - uses: './.github/actions/compilers' + name: 'ext/Setup' + with: + static_exts: 'etc json/* */escape' + launchable-token: ${{ secrets.LAUNCHABLE_TOKEN }} + launchable-url: ${{ secrets.LAUNCHABLE_BASE_URL }} + - uses: './.github/actions/compilers' + name: 'GCC 14' + with: { tag: 'gcc-14' } + - uses: './.github/actions/compilers' + name: 'GCC 13' + with: { tag: 'gcc-13' } + - uses: './.github/actions/compilers' + name: 'GCC 12' + with: { tag: 'gcc-12' } + - uses: './.github/actions/compilers' + name: 'GCC 11' + with: { tag: 'gcc-11' } + - uses: './.github/actions/compilers' + name: 'GCC 10' + with: { tag: 'gcc-10' } + - uses: './.github/actions/compilers' + name: 'GCC 9' + with: { tag: 'gcc-9' } + - uses: './.github/actions/compilers' + name: 'GCC 8' + with: { tag: 'gcc-8' } + - uses: './.github/actions/compilers' + name: 'GCC 7' + with: { tag: 'gcc-7' } compile5: name: 'omnibus compilations, #5' @@ -141,20 +247,43 @@ jobs: - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 with: { sparse-checkout-cone-mode: false, sparse-checkout: /.github } - { uses: './.github/actions/setup/directories', with: { srcdir: 'src', builddir: 'build', makeup: true, fetch-depth: 10 } } - # -Wno-strict-prototypes is necessary with current clang-15 since - # older autoconf generate functions without prototype and -pedantic - # now implies strict-prototypes. Disabling the error but leaving the - # warning generates a lot of noise from use of ANYARGS in - # rb_define_method() and friends. - # See: https://github.com/llvm/llvm-project/commit/11da1b53d8cd3507959022cd790d5a7ad4573d94 - - { uses: './.github/actions/compilers', name: 'C99', with: { CFLAGS: '-std=c99 -Werror=pedantic -pedantic-errors -Wno-strict-prototypes' } } - - { uses: './.github/actions/compilers', name: 'C11', with: { CFLAGS: '-std=c11 -Werror=pedantic -pedantic-errors -Wno-strict-prototypes' } } - - { uses: './.github/actions/compilers', name: 'C17', with: { CFLAGS: '-std=c17 -Werror=pedantic -pedantic-errors -Wno-strict-prototypes' } } - - { uses: './.github/actions/compilers', name: 'C23', with: { CFLAGS: '-std=c2x -Werror=pedantic -pedantic-errors -Wno-strict-prototypes' } } - - { uses: './.github/actions/compilers', name: 'C++98', with: { CXXFLAGS: '-std=c++98 -Werror=pedantic -pedantic-errors -Wno-c++11-long-long' } } - - { uses: './.github/actions/compilers', name: 'C++11', with: { CXXFLAGS: '-std=c++11 -Werror=pedantic -pedantic-errors -Wno-c++11-long-long' } } - - { uses: './.github/actions/compilers', name: 'C++14', with: { CXXFLAGS: '-std=c++14 -Werror=pedantic -pedantic-errors -Wno-c++11-long-long' } } - - { uses: './.github/actions/compilers', name: 'C++17', with: { CXXFLAGS: '-std=c++17 -Werror=pedantic -pedantic-errors -Wno-c++11-long-long' } } + - name: 'GCC 13 LTO' + uses: './.github/actions/compilers' + with: + tag: gcc-13 + with_gcc: 'gcc-13 -flto=auto -ffat-lto-objects -Werror=lto-type-mismatch' + optflags: '-O2' + enable_shared: false + - uses: './.github/actions/compilers' + name: 'ext/Setup' + with: + static_exts: 'etc json/* */escape' + launchable-token: ${{ secrets.LAUNCHABLE_TOKEN }} + launchable-url: ${{ secrets.LAUNCHABLE_BASE_URL }} + - uses: './.github/actions/compilers' + name: 'GCC 14' + with: { tag: 'gcc-14' } + - uses: './.github/actions/compilers' + name: 'GCC 13' + with: { tag: 'gcc-13' } + - uses: './.github/actions/compilers' + name: 'GCC 12' + with: { tag: 'gcc-12' } + - uses: './.github/actions/compilers' + name: 'GCC 11' + with: { tag: 'gcc-11' } + - uses: './.github/actions/compilers' + name: 'GCC 10' + with: { tag: 'gcc-10' } + - uses: './.github/actions/compilers' + name: 'GCC 9' + with: { tag: 'gcc-9' } + - uses: './.github/actions/compilers' + name: 'GCC 8' + with: { tag: 'gcc-8' } + - uses: './.github/actions/compilers' + name: 'GCC 7' + with: { tag: 'gcc-7' } compile6: name: 'omnibus compilations, #6' @@ -166,14 +295,43 @@ jobs: - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 with: { sparse-checkout-cone-mode: false, sparse-checkout: /.github } - { uses: './.github/actions/setup/directories', with: { srcdir: 'src', builddir: 'build', makeup: true, fetch-depth: 10 } } - - { uses: './.github/actions/compilers', name: 'C++20', with: { CXXFLAGS: '-std=c++20 -Werror=pedantic -pedantic-errors -Wno-c++11-long-long' } } - - { uses: './.github/actions/compilers', name: 'C++23', with: { CXXFLAGS: '-std=c++23 -Werror=pedantic -pedantic-errors -Wno-c++11-long-long' } } - - { uses: './.github/actions/compilers', name: 'C++26', with: { CXXFLAGS: '-std=c++26 -Werror=pedantic -pedantic-errors -Wno-c++11-long-long' } } - - { uses: './.github/actions/compilers', name: 'gmp', with: { append_configure: '--with-gmp', check: 'ruby/test_bignum.rb', mspecopt: "/github/workspace/src/spec/ruby/core/integer" } } - - { uses: './.github/actions/compilers', name: 'jemalloc', with: { append_configure: '--with-jemalloc' } } - - { uses: './.github/actions/compilers', name: 'valgrind', with: { append_configure: '--with-valgrind' } } - - { uses: './.github/actions/compilers', name: 'coroutine=ucontext', with: { append_configure: '--with-coroutine=ucontext' } } - - { uses: './.github/actions/compilers', name: 'coroutine=pthread', with: { append_configure: '--with-coroutine=pthread' } } + - name: 'GCC 13 LTO' + uses: './.github/actions/compilers' + with: + tag: gcc-13 + with_gcc: 'gcc-13 -flto=auto -ffat-lto-objects -Werror=lto-type-mismatch' + optflags: '-O2' + enable_shared: false + - uses: './.github/actions/compilers' + name: 'ext/Setup' + with: + static_exts: 'etc json/* */escape' + launchable-token: ${{ secrets.LAUNCHABLE_TOKEN }} + launchable-url: ${{ secrets.LAUNCHABLE_BASE_URL }} + - uses: './.github/actions/compilers' + name: 'GCC 14' + with: { tag: 'gcc-14' } + - uses: './.github/actions/compilers' + name: 'GCC 13' + with: { tag: 'gcc-13' } + - uses: './.github/actions/compilers' + name: 'GCC 12' + with: { tag: 'gcc-12' } + - uses: './.github/actions/compilers' + name: 'GCC 11' + with: { tag: 'gcc-11' } + - uses: './.github/actions/compilers' + name: 'GCC 10' + with: { tag: 'gcc-10' } + - uses: './.github/actions/compilers' + name: 'GCC 9' + with: { tag: 'gcc-9' } + - uses: './.github/actions/compilers' + name: 'GCC 8' + with: { tag: 'gcc-8' } + - uses: './.github/actions/compilers' + name: 'GCC 7' + with: { tag: 'gcc-7' } compile7: name: 'omnibus compilations, #7' @@ -185,14 +343,43 @@ jobs: - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 with: { sparse-checkout-cone-mode: false, sparse-checkout: /.github } - { uses: './.github/actions/setup/directories', with: { srcdir: 'src', builddir: 'build', makeup: true, fetch-depth: 10 } } - - { uses: './.github/actions/compilers', name: 'disable-jit', with: { append_configure: '--disable-yjit --disable-rjit' } } - - { uses: './.github/actions/compilers', name: 'disable-dln', with: { append_configure: '--disable-dln' } } - - { uses: './.github/actions/compilers', name: 'enable-mkmf-verbose', with: { append_configure: '--enable-mkmf-verbose' } } - - { uses: './.github/actions/compilers', name: 'disable-rubygems', with: { append_configure: '--disable-rubygems' } } - - { uses: './.github/actions/compilers', name: 'RUBY_DEVEL', with: { append_configure: '--enable-devel' } } - - { uses: './.github/actions/compilers', name: 'OPT_THREADED_CODE=0', with: { cppflags: '-DOPT_THREADED_CODE=0' } } - - { uses: './.github/actions/compilers', name: 'OPT_THREADED_CODE=1', with: { cppflags: '-DOPT_THREADED_CODE=1' } } - - { uses: './.github/actions/compilers', name: 'OPT_THREADED_CODE=2', with: { cppflags: '-DOPT_THREADED_CODE=2' } } + - name: 'GCC 13 LTO' + uses: './.github/actions/compilers' + with: + tag: gcc-13 + with_gcc: 'gcc-13 -flto=auto -ffat-lto-objects -Werror=lto-type-mismatch' + optflags: '-O2' + enable_shared: false + - uses: './.github/actions/compilers' + name: 'ext/Setup' + with: + static_exts: 'etc json/* */escape' + launchable-token: ${{ secrets.LAUNCHABLE_TOKEN }} + launchable-url: ${{ secrets.LAUNCHABLE_BASE_URL }} + - uses: './.github/actions/compilers' + name: 'GCC 14' + with: { tag: 'gcc-14' } + - uses: './.github/actions/compilers' + name: 'GCC 13' + with: { tag: 'gcc-13' } + - uses: './.github/actions/compilers' + name: 'GCC 12' + with: { tag: 'gcc-12' } + - uses: './.github/actions/compilers' + name: 'GCC 11' + with: { tag: 'gcc-11' } + - uses: './.github/actions/compilers' + name: 'GCC 10' + with: { tag: 'gcc-10' } + - uses: './.github/actions/compilers' + name: 'GCC 9' + with: { tag: 'gcc-9' } + - uses: './.github/actions/compilers' + name: 'GCC 8' + with: { tag: 'gcc-8' } + - uses: './.github/actions/compilers' + name: 'GCC 7' + with: { tag: 'gcc-7' } compile8: name: 'omnibus compilations, #8' @@ -204,14 +391,43 @@ jobs: - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 with: { sparse-checkout-cone-mode: false, sparse-checkout: /.github } - { uses: './.github/actions/setup/directories', with: { srcdir: 'src', builddir: 'build', makeup: true, fetch-depth: 10 } } - - { uses: './.github/actions/compilers', name: 'NDEBUG', with: { cppflags: '-DNDEBUG' } } - - { uses: './.github/actions/compilers', name: 'RUBY_DEBUG', with: { cppflags: '-DRUBY_DEBUG' } } - - { uses: './.github/actions/compilers', name: 'ARRAY_DEBUG', with: { cppflags: '-DARRAY_DEBUG' } } - - { uses: './.github/actions/compilers', name: 'BIGNUM_DEBUG', with: { cppflags: '-DBIGNUM_DEBUG' } } - - { uses: './.github/actions/compilers', name: 'CCAN_LIST_DEBUG', with: { cppflags: '-DCCAN_LIST_DEBUG' } } - - { uses: './.github/actions/compilers', name: 'CPDEBUG=-1', with: { cppflags: '-DCPDEBUG=-1' } } - - { uses: './.github/actions/compilers', name: 'ENC_DEBUG', with: { cppflags: '-DENC_DEBUG' } } - - { uses: './.github/actions/compilers', name: 'GC_DEBUG', with: { cppflags: '-DGC_DEBUG' } } + - name: 'GCC 13 LTO' + uses: './.github/actions/compilers' + with: + tag: gcc-13 + with_gcc: 'gcc-13 -flto=auto -ffat-lto-objects -Werror=lto-type-mismatch' + optflags: '-O2' + enable_shared: false + - uses: './.github/actions/compilers' + name: 'ext/Setup' + with: + static_exts: 'etc json/* */escape' + launchable-token: ${{ secrets.LAUNCHABLE_TOKEN }} + launchable-url: ${{ secrets.LAUNCHABLE_BASE_URL }} + - uses: './.github/actions/compilers' + name: 'GCC 14' + with: { tag: 'gcc-14' } + - uses: './.github/actions/compilers' + name: 'GCC 13' + with: { tag: 'gcc-13' } + - uses: './.github/actions/compilers' + name: 'GCC 12' + with: { tag: 'gcc-12' } + - uses: './.github/actions/compilers' + name: 'GCC 11' + with: { tag: 'gcc-11' } + - uses: './.github/actions/compilers' + name: 'GCC 10' + with: { tag: 'gcc-10' } + - uses: './.github/actions/compilers' + name: 'GCC 9' + with: { tag: 'gcc-9' } + - uses: './.github/actions/compilers' + name: 'GCC 8' + with: { tag: 'gcc-8' } + - uses: './.github/actions/compilers' + name: 'GCC 7' + with: { tag: 'gcc-7' } compile9: name: 'omnibus compilations, #9' @@ -223,14 +439,43 @@ jobs: - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 with: { sparse-checkout-cone-mode: false, sparse-checkout: /.github } - { uses: './.github/actions/setup/directories', with: { srcdir: 'src', builddir: 'build', makeup: true, fetch-depth: 10 } } - - { uses: './.github/actions/compilers', name: 'HASH_DEBUG', with: { cppflags: '-DHASH_DEBUG' } } - - { uses: './.github/actions/compilers', name: 'ID_TABLE_DEBUG', with: { cppflags: '-DID_TABLE_DEBUG' } } - - { uses: './.github/actions/compilers', name: 'RGENGC_DEBUG=-1', with: { cppflags: '-DRGENGC_DEBUG=-1' } } - - { uses: './.github/actions/compilers', name: 'SYMBOL_DEBUG', with: { cppflags: '-DSYMBOL_DEBUG' } } - - { uses: './.github/actions/compilers', name: 'RGENGC_CHECK_MODE', with: { cppflags: '-DRGENGC_CHECK_MODE' } } - - { uses: './.github/actions/compilers', name: 'VM_CHECK_MODE', with: { cppflags: '-DVM_CHECK_MODE' } } - - { uses: './.github/actions/compilers', name: 'USE_EMBED_CI=0', with: { cppflags: '-DUSE_EMBED_CI=0' } } - - { uses: './.github/actions/compilers', name: 'USE_FLONUM=0', with: { cppflags: '-DUSE_FLONUM=0', append_configure: '--disable-yjit' } } + - name: 'GCC 13 LTO' + uses: './.github/actions/compilers' + with: + tag: gcc-13 + with_gcc: 'gcc-13 -flto=auto -ffat-lto-objects -Werror=lto-type-mismatch' + optflags: '-O2' + enable_shared: false + - uses: './.github/actions/compilers' + name: 'ext/Setup' + with: + static_exts: 'etc json/* */escape' + launchable-token: ${{ secrets.LAUNCHABLE_TOKEN }} + launchable-url: ${{ secrets.LAUNCHABLE_BASE_URL }} + - uses: './.github/actions/compilers' + name: 'GCC 14' + with: { tag: 'gcc-14' } + - uses: './.github/actions/compilers' + name: 'GCC 13' + with: { tag: 'gcc-13' } + - uses: './.github/actions/compilers' + name: 'GCC 12' + with: { tag: 'gcc-12' } + - uses: './.github/actions/compilers' + name: 'GCC 11' + with: { tag: 'gcc-11' } + - uses: './.github/actions/compilers' + name: 'GCC 10' + with: { tag: 'gcc-10' } + - uses: './.github/actions/compilers' + name: 'GCC 9' + with: { tag: 'gcc-9' } + - uses: './.github/actions/compilers' + name: 'GCC 8' + with: { tag: 'gcc-8' } + - uses: './.github/actions/compilers' + name: 'GCC 7' + with: { tag: 'gcc-7' } compileX: name: 'omnibus compilations, #10' diff --git a/.github/workflows/cygwin.yml b/.github/workflows/cygwin.yml deleted file mode 100644 index 3467fc0b704a56..00000000000000 --- a/.github/workflows/cygwin.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: Cygwin -on: - push: - paths-ignore: - - 'doc/**' - - '**/man/*' - - '**.md' - - '**.rdoc' - - '**/.document' - - '.*.yml' - pull_request: - paths-ignore: - - 'doc/**' - - '**/man/*' - - '**.md' - - '**.rdoc' - - '**/.document' - - '.*.yml' - merge_group: - -concurrency: - group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} - cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} - -permissions: - contents: read - -jobs: - make: - runs-on: windows-2022 - - 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.title, 'Document') - || contains(github.event.pull_request.labels.*.name, 'Documentation') - || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') - )}} - - steps: - - run: git config --global core.autocrlf input - - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - - name: Setup Cygwin - uses: cygwin/cygwin-install-action@master - with: - packages: ruby gcc-core make autoconf libtool libssl-devel libyaml-devel libffi-devel zlib-devel - - - name: configure - run: | - ./autogen.sh - ./configure --disable-install-doc - shell: C:\cygwin\bin\bash.EXE --noprofile --norc -e -o igncr -o pipefail {0} - - - name: make all - timeout-minutes: 30 - run: make -j2 V=1 - shell: C:\cygwin\bin\bash.EXE --noprofile --norc -e -o igncr -o pipefail {0} diff --git a/.github/workflows/dependabot_automerge.yml b/.github/workflows/dependabot_automerge.yml deleted file mode 100644 index 69ab5d9131bb4b..00000000000000 --- a/.github/workflows/dependabot_automerge.yml +++ /dev/null @@ -1,30 +0,0 @@ -# from https://github.com/gofiber/swagger/blob/main/.github/workflows/dependabot_automerge.yml -name: Dependabot auto-merge -on: - pull_request_target: - -jobs: - automerge: - runs-on: ubuntu-latest - - if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }} - - steps: - - name: Dependabot metadata - uses: dependabot/fetch-metadata@dbb049abf0d677abbd7f7eee0375145b417fdd34 # v2.2.0 - id: metadata - - - name: Wait for status checks - uses: lewagon/wait-on-check-action@ccfb013c15c8afb7bf2b7c028fb74dc5a068cccc # v1.3.4 - with: - repo-token: ${{ secrets.MATZBOT_GITHUB_TOKEN }} - ref: ${{ github.event.pull_request.head.sha || github.sha }} - check-regexp: 'make \(check, .*\)' - wait-interval: 30 - - - name: Auto-merge for Dependabot PRs - if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch' }} - run: gh pr merge --auto --rebase "$PR_URL" - env: - PR_URL: ${{ github.event.pull_request.html_url }} - GITHUB_TOKEN: ${{ secrets.MATZBOT_GITHUB_TOKEN }} diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 48990e487047d3..71a2efd4781e42 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -2,12 +2,12 @@ name: macOS on: push: paths-ignore: - - 'doc/**' - - '**/man/*' - - '**.md' - - '**.rdoc' - - '**/.document' - - '.*.yml' + - "doc/**" + - "**/man/*" + - "**.md" + - "**.rdoc" + - "**/.document" + - ".*.yml" pull_request: # Do not use paths-ignore for required status checks # https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks @@ -29,13 +29,13 @@ jobs: os: macos-14 - test_task: check os: macos-14 - configure_args: '--with-gcc=gcc-14' + configure_args: "--with-gcc=gcc-14" - test_task: check os: macos-14 - configure_args: '--with-jemalloc --with-opt-dir=$(brew --prefix jemalloc)' + configure_args: "--with-jemalloc --with-opt-dir=$(brew --prefix jemalloc)" - test_task: check os: macos-14 - configure_args: '--with-gmp' + configure_args: "--with-gmp" - test_task: test-all test_opts: --repeat-count=2 os: macos-14 @@ -130,6 +130,7 @@ jobs: os: ${{ matrix.os }} test-opts: ${{ matrix.test_opts }} launchable-token: ${{ secrets.LAUNCHABLE_TOKEN }} + launchable-url: ${{ secrets.LAUNCHABLE_BASE_URL }} builddir: build srcdir: src continue-on-error: true @@ -146,17 +147,17 @@ jobs: make -s ${{ matrix.test_task }} ${TESTS:+TESTS="$TESTS"} timeout-minutes: 60 env: - RUBY_TESTOPTS: '-q --tty=no' - TEST_BUNDLED_GEMS_ALLOW_FAILURES: 'typeprof' - PRECHECK_BUNDLED_GEMS: 'no' + RUBY_TESTOPTS: "-q --tty=no" + TEST_BUNDLED_GEMS_ALLOW_FAILURES: "typeprof" + PRECHECK_BUNDLED_GEMS: "no" - name: make skipped tests run: | make -s test-all TESTS="${TESTS//-n!\//-n/}" env: - GNUMAKEFLAGS: '' - RUBY_TESTOPTS: '-v --tty=no' - PRECHECK_BUNDLED_GEMS: 'no' + GNUMAKEFLAGS: "" + RUBY_TESTOPTS: "-v --tty=no" + PRECHECK_BUNDLED_GEMS: "no" if: ${{ matrix.test_task == 'check' && matrix.skipped_tests }} continue-on-error: ${{ matrix.continue-on-skipped_tests || false }} diff --git a/.github/workflows/mingw.yml b/.github/workflows/mingw.yml index 37cbfa5f385663..dd8d7cd1cbaadc 100644 --- a/.github/workflows/mingw.yml +++ b/.github/workflows/mingw.yml @@ -2,20 +2,20 @@ name: MinGW on: push: paths-ignore: - - 'doc/**' - - '**/man/*' - - '**.md' - - '**.rdoc' - - '**/.document' - - '.*.yml' + - "doc/**" + - "**/man/*" + - "**.md" + - "**.rdoc" + - "**/.document" + - ".*.yml" pull_request: paths-ignore: - - 'doc/**' - - '**/man/*' - - '**.md' - - '**.rdoc' - - '**/.document' - - '.*.yml' + - "doc/**" + - "**/man/*" + - "**.md" + - "**.rdoc" + - "**/.document" + - ".*.yml" merge_group: concurrency: @@ -37,11 +37,11 @@ jobs: env: MSYSTEM: ${{ matrix.msystem }} MSYS2_ARCH: x86_64 - CHOST: 'x86_64-w64-mingw32' - CFLAGS: '-march=x86-64 -mtune=generic -O3 -pipe' - CXXFLAGS: '-march=x86-64 -mtune=generic -O3 -pipe' - CPPFLAGS: '-D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048' - LDFLAGS: '-pipe' + CHOST: "x86_64-w64-mingw32" + CFLAGS: "-march=x86-64 -mtune=generic -O3 -pipe" + CXXFLAGS: "-march=x86-64 -mtune=generic -O3 -pipe" + CPPFLAGS: "-D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048" + LDFLAGS: "-pipe" GITPULLOPTIONS: --no-tags origin ${{ github.ref }} strategy: @@ -49,10 +49,10 @@ jobs: include: # To mitigate flakiness of MinGW CI, we test only one runtime that newer MSYS2 uses. # Ruby 3.2 is the first Windows Ruby to use OpenSSL 3.x - - msystem: 'UCRT64' - baseruby: '3.2' - test_task: 'check' - test-all-opts: '--name=!/TestObjSpace#test_reachable_objects_during_iteration/' + - msystem: "UCRT64" + baseruby: "3.2" + test_task: "check" + test-all-opts: "--name=!/TestObjSpace#test_reachable_objects_during_iteration/" fail-fast: false if: >- @@ -123,12 +123,11 @@ jobs: uses: ./.github/actions/launchable/setup with: os: windows-2022 - # If we support new test task, we need to change this test-opts. - test-opts: --retry --job-status=normal --show-skip --timeout-scale=1.5 - ${{ matrix.test-all-opts }} launchable-token: ${{ secrets.LAUNCHABLE_TOKEN }} + launchable-url: ${{ secrets.LAUNCHABLE_BASE_URL }} builddir: build srcdir: src + test-tasks: '["test", "test-all"]' continue-on-error: true - name: test @@ -136,8 +135,8 @@ jobs: run: make test shell: cmd env: - GNUMAKEFLAGS: '' - RUBY_TESTOPTS: '-v --tty=no' + GNUMAKEFLAGS: "" + RUBY_TESTOPTS: "-v --tty=no" if: ${{ matrix.test_task == 'check' || matrix.test_task == 'test' }} - name: test-all diff --git a/.github/workflows/parsey.yml b/.github/workflows/parsey.yml deleted file mode 100644 index a7416952b6d49e..00000000000000 --- a/.github/workflows/parsey.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: parse.y -on: - push: - paths-ignore: - - 'doc/**' - - '**/man/*' - - '**.md' - - '**.rdoc' - - '**/.document' - - '.*.yml' - pull_request: - paths-ignore: - - 'doc/**' - - '**/man/*' - - '**.md' - - '**.rdoc' - - '**/.document' - - '.*.yml' - merge_group: - -concurrency: - group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} - cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} - -permissions: - contents: read - -jobs: - make: - strategy: - matrix: - include: - - test_task: check - - test_task: test-bundler-parallel - - test_task: test-bundled-gems - fail-fast: false - - env: - GITPULLOPTIONS: --no-tags origin ${{ github.ref }} - RUBY_DEBUG: ci - SETARCH: ${{ matrix.arch && format('setarch {0}', matrix.arch) }} - - runs-on: ubuntu-22.04 - - 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.title, 'Document') - || contains(github.event.pull_request.labels.*.name, 'Documentation') - || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') - )}} - - steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - with: - sparse-checkout-cone-mode: false - sparse-checkout: /.github - - - uses: ./.github/actions/setup/ubuntu - - - uses: ./.github/actions/setup/directories - with: - srcdir: src - builddir: build - makeup: true - clean: true - dummy-files: ${{ matrix.test_task == 'check' }} - - - name: Run configure - run: ../src/configure -C --disable-install-doc cppflags=-DRUBY_DEBUG --with-parser=parse.y - - - run: make - - - name: make ${{ matrix.test_task }} - run: make -s ${{ matrix.test_task }} RUN_OPTS="$RUN_OPTS" SPECOPTS="$SPECOPTS" - env: - RUBY_TESTOPTS: ${{ matrix.testopts }} - EXCLUDES: '../src/test/.excludes-parsey' - RUN_OPTS: ${{ matrix.run_opts || '--parser=parse.y' }} - SPECOPTS: ${{ matrix.specopts || '-T --parser=parse.y' }} - TEST_BUNDLED_GEMS_ALLOW_FAILURES: 'typeprof' - - - uses: ./.github/actions/slack - with: - label: ${{ matrix.run_opts }} - SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot - if: ${{ failure() }} - -defaults: - run: - working-directory: build diff --git a/.github/workflows/pr-playground.yml b/.github/workflows/pr-playground.yml deleted file mode 100644 index cc060061421acd..00000000000000 --- a/.github/workflows/pr-playground.yml +++ /dev/null @@ -1,127 +0,0 @@ -name: Post Playground link to PR -on: - pull_request_target: - types: [labeled] - workflow_run: - workflows: ["WebAssembly"] - types: [completed] - -jobs: - post-summary: - name: Post Playground link - runs-on: ubuntu-latest - permissions: - pull-requests: write - # Post a comment only if the PR status check is passed and the PR is labeled with `Playground`. - # Triggered twice: when the PR is labeled and when PR build is passed. - if: >- - ${{ false - || (true - && github.event_name == 'pull_request_target' - && contains(github.event.pull_request.labels.*.name, 'Playground')) - || (true - && github.event_name == 'workflow_run' - && github.event.workflow_run.conclusion == 'success' - && github.event.workflow_run.event == 'pull_request') - }} - steps: - - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const fs = require('fs/promises'); - - const buildWorkflowPath = '.github/workflows/wasm.yml'; - const findSuccessfuBuildRun = async (pr) => { - const opts = github.rest.actions.listWorkflowRunsForRepo.endpoint.merge({ - owner: context.repo.owner, - repo: context.repo.repo, - status: 'success', - branch: pr.head.ref, - }); - const runs = await github.paginate(opts); - const buildRun = runs.find(run => run.path == buildWorkflowPath); - return buildRun; - } - - const postComment = async (body, pr) => { - const { data: comments } = await github.rest.issues.listComments({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: pr.number, - }); - - const commentOpts = { owner: context.repo.owner, repo: context.repo.repo, body: comment }; - - const existingComment = comments.find(comment => comment.body.startsWith(magicComment)); - if (existingComment) { - core.info(`Updating existing comment: ${existingComment.html_url}`); - await github.rest.issues.updateComment({ - ...commentOpts, comment_id: existingComment.id - }); - } else { - await github.rest.issues.createComment({ - ...commentOpts, issue_number: pr.number - }); - } - } - - const derivePRNumber = async () => { - if (context.payload.pull_request) { - return context.payload.pull_request.number; - } - // Workaround for https://github.com/orgs/community/discussions/25220 - - const { data: { artifacts } } = await github.rest.actions.listWorkflowRunArtifacts({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: context.payload.workflow_run.id, - }); - const artifact = artifacts.find(artifact => artifact.name == 'github-pr-info'); - if (!artifact) { - throw new Error('Cannot find github-pr-info.txt artifact'); - } - - const { data } = await github.rest.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: artifact.id, - archive_format: 'zip', - }); - - await fs.writeFile('pr-info.zip', Buffer.from(data)); - await exec.exec('unzip', ['pr-info.zip']); - return await fs.readFile('github-pr-info.txt', 'utf8'); - } - - const prNumber = await derivePRNumber(); - - const { data: pr } = await github.rest.pulls.get({ - owner: context.repo.owner, - repo: context.repo.repo, - pull_number: prNumber, - }); - - core.info(`Checking if the PR ${prNumber} is labeled with Playground...`); - if (!pr.labels.some(label => label.name == 'Playground')) { - core.info(`The PR is not labeled with Playground.`); - return; - } - - core.info(`Checking if the build is successful for ${pr.head.ref} in ${pr.head.repo.owner.login}/${pr.head.repo.name}...`); - const buildRun = await findSuccessfuBuildRun(pr); - if (!buildRun) { - core.info(`No successful build run found for ${buildWorkflowPath} on ${pr.head.ref} yet.`); - return; - } - core.info(`Found a successful build run: ${buildRun.html_url}`); - - const runLink = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`; - const magicComment = ``; - const comment = `${magicComment} - **Try on Playground**: https://ruby.github.io/play-ruby?run=${buildRun.id} - This is an automated comment by [\`pr-playground.yml\`](${runLink}) workflow. - `; - core.info(`Comment: ${comment}`); - await postComment(comment, pr); - diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 5d4474d978f51a..00000000000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Start release workflow -on: - push: - tags: - - '*' - -jobs: - notify: - runs-on: ubuntu-latest - steps: - - name: Build release package - run: | - curl -L -X POST \ - -H "Authorization: Bearer ${{ secrets.MATZBOT_GITHUB_WORKFLOW_TOKEN }}" \ - -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/repos/ruby/actions/dispatches \ - -d '{"event_type": "${{ github.ref }}"}' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 5534e3defec392..00000000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,108 +0,0 @@ -name: Publish Ruby packages - -on: - repository_dispatch: - types: - - release - workflow_dispatch: - inputs: - version: - description: 'Version of the Ruby package to release' - required: true - default: '3.3.4' - -jobs: - release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - uses: ruby/setup-ruby@v1 - with: - ruby-version: 3.3.4 - - - name: Store Ruby version - run: | - echo "RUBY_VERSION=${{ github.event.client_payload.version || github.event.inputs.version }}" >> $GITHUB_ENV - - - name: Store ABI version - run: echo "ABI_VERSION=$(echo ${{ env.RUBY_VERSION }} | cut -d '.' -f 1-2)" >> $GITHUB_ENV - - - name: Copy draft package `/tmp` to `/pub` directory - run: tool/release.sh ${{ env.RUBY_VERSION }} - env: - AWS_ACCESS_KEY_ID: ${{ secrets.FTP_R_L_O_AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.FTP_R_L_O_AWS_SECRET_ACCESS_KEY }} - AWS_DEFAULT_REGION: us-west-2 - - - name: Purge URLs of release package - run: | - curl -X POST \ - -H "Fastly-Key: ${{ secrets.FASTLY_PURGE_TOKEN }}" \ - https://api.fastly.com/purge/cache.ruby-lang.org/pub/ruby/${{ env.ABI_VERSION }}/ruby-${{ env.RUBY_VERSION }}.tar.gz - curl -X POST \ - -H "Fastly-Key: ${{ secrets.FASTLY_PURGE_TOKEN }}" \ - https://api.fastly.com/purge/cache.ruby-lang.org/pub/ruby/${{ env.ABI_VERSION }}/ruby-${{ env.RUBY_VERSION }}.tar.xz - curl -X POST \ - -H "Fastly-Key: ${{ secrets.FASTLY_PURGE_TOKEN }}" \ - https://api.fastly.com/purge/cache.ruby-lang.org/pub/ruby/${{ env.ABI_VERSION }}/ruby-${{ env.RUBY_VERSION }}.zip - - - name: Create a release on GitHub - run: | - RELEASE_TAG=$(echo v${{ env.RUBY_VERSION }} | sed 's/\./_/g') - echo $RELEASE_TAG - PREVIOUS_RELEASE_TAG=$(echo $RELEASE_TAG | awk 'BEGIN {FS="_"; OFS="_"}{ $NF=$NF-1; print }') - 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 }} - - - name: Update versions index - run: | - curl -L -X POST \ - -H "Authorization: Bearer ${{ secrets.MATZBOT_GITHUB_WORKFLOW_TOKEN }}" \ - -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/repos/ruby/actions/dispatches \ - -d '{"event_type": "update_index"}' - - - name: Set latest flag for Ruby 3.3 - if: contains(${{ env.RUBY_VERSION }}, '3.3.') - run: | - echo "LATEST=true" >> $GITHUB_ENV - - - name: Build and push Docker images - run: | - curl -L -X POST \ - -H "Authorization: Bearer ${{ secrets.MATZBOT_GITHUB_WORKFLOW_TOKEN }}" \ - -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/repos/ruby/docker-images/dispatches \ - -d '{"event_type": "build", "client_payload": {"ruby_version": "${{ env.RUBY_VERSION }}", "arch": "amd64", "latest": "${{ env.LATEST }}"}}' - - - name: Build snapcraft packages - run: | - curl -L -X POST \ - -H "Authorization: Bearer ${{ secrets.MATZBOT_GITHUB_WORKFLOW_TOKEN }}" \ - -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/repos/ruby/snap.ruby/dispatches \ - -d '{"event_type": "build", "client_payload": {"ruby_version": "${{ env.RUBY_VERSION }}"}}' - - - name: Update ruby-build definition - run: | - curl -L -X POST \ - -H "Authorization: Bearer ${{ secrets.RUBY_BUILD_WORKFLOW_TOKEN }}" \ - -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/repos/rbenv/ruby-build/dispatches \ - -d '{"event_type": "update-ruby", "client_payload": {"ruby_version": "${{ env.RUBY_VERSION }}", "openssl_version": "3.0.15"}}' - - - name: Update all-ruby definition - run: | - curl -L -X POST \ - -H "Authorization: Bearer ${{ secrets.MATZBOT_GITHUB_WORKFLOW_TOKEN }}" \ - -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/repos/ruby/all-ruby/dispatches \ - -d '{"event_type": "update"}' diff --git a/.github/workflows/rjit-bindgen.yml b/.github/workflows/rjit-bindgen.yml deleted file mode 100644 index c2ec4a6a6824a1..00000000000000 --- a/.github/workflows/rjit-bindgen.yml +++ /dev/null @@ -1,86 +0,0 @@ -name: RJIT bindgen -on: - push: - paths-ignore: - - 'doc/**' - - '**/man/*' - - '**.md' - - '**.rdoc' - - '**/.document' - - '.*.yml' - pull_request: - paths-ignore: - - 'doc/**' - - '**/man/*' - - '**.md' - - '**.rdoc' - - '**/.document' - - '.*.yml' - merge_group: - -concurrency: - group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} - cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} - -permissions: - contents: read - -jobs: - make: - strategy: - matrix: - include: - - task: rjit-bindgen - fail-fast: false - - runs-on: ubuntu-20.04 - - 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.title, 'Document') - || contains(github.event.pull_request.labels.*.name, 'Documentation') - || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') - )}} - - steps: - - name: Set up Ruby - uses: ruby/setup-ruby@a6e6f86333f0a2523ece813039b8b4be04560854 # v1.190.0 - with: - ruby-version: '3.1' - - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - with: - sparse-checkout-cone-mode: false - sparse-checkout: /.github - - - uses: ./.github/actions/setup/ubuntu - - - uses: ./.github/actions/setup/directories - with: - srcdir: src - builddir: build - makeup: true - - - name: Run configure - run: ../src/configure -C --disable-install-doc --prefix=$(pwd)/install --enable-yjit=dev_nodebug - - - run: make - - - run: make install - - - run: make ${{ matrix.task }} - - - run: git diff --exit-code - working-directory: src - - - uses: ./.github/actions/slack - with: - SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot - if: ${{ failure() }} - -defaults: - run: - working-directory: build diff --git a/.github/workflows/rjit.yml b/.github/workflows/rjit.yml index 12e6b94b53ff9f..bf65aa8176d17c 100644 --- a/.github/workflows/rjit.yml +++ b/.github/workflows/rjit.yml @@ -2,22 +2,22 @@ name: RJIT on: push: paths-ignore: - - 'doc/**' - - '**.md' - - '**.rdoc' - - '**/.document' - - '**.[1-8]' - - '**.ronn' - - '.*.yml' + - "doc/**" + - "**.md" + - "**.rdoc" + - "**/.document" + - "**.[1-8]" + - "**.ronn" + - ".*.yml" pull_request: paths-ignore: - - 'doc/**' - - '**.md' - - '**.rdoc' - - '**/.document' - - '**.[1-8]' - - '**.ronn' - - '.*.yml' + - "doc/**" + - "**.md" + - "**.rdoc" + - "**/.document" + - "**.[1-8]" + - "**.ronn" + - ".*.yml" merge_group: concurrency: @@ -33,8 +33,8 @@ jobs: matrix: # main variables included in the job name test_task: [check] - run_opts: ['--rjit-call-threshold=1'] - arch: [''] + run_opts: ["--rjit-call-threshold=1"] + arch: [""] fail-fast: false env: @@ -83,12 +83,12 @@ jobs: uses: ./.github/actions/launchable/setup with: os: ubuntu-22.04 - test-task: test launchable-token: ${{ secrets.LAUNCHABLE_TOKEN }} + launchable-url: ${{ secrets.LAUNCHABLE_BASE_URL }} builddir: build srcdir: src - launchable-workspace: ruby-make-btest test-opts: ${{ matrix.run_opts }} + test-tasks: '["test", "test-all"]' continue-on-error: true - name: make test @@ -96,7 +96,7 @@ jobs: $SETARCH make -s test RUN_OPTS="$RUN_OPTS" timeout-minutes: 30 env: - GNUMAKEFLAGS: '' + GNUMAKEFLAGS: "" RUBY_TESTOPTS: >- ${{ env.TESTS }} --tty=no @@ -107,8 +107,8 @@ jobs: $SETARCH make -s test-all RUN_OPTS="$RUN_OPTS" timeout-minutes: 60 env: - GNUMAKEFLAGS: '' - RUBY_TESTOPTS: '-q --tty=no' + GNUMAKEFLAGS: "" + RUBY_TESTOPTS: "-q --tty=no" RUN_OPTS: ${{ matrix.run_opts }} - name: make test-spec @@ -116,7 +116,7 @@ jobs: $SETARCH make -s test-spec RUN_OPTS="$RUN_OPTS" timeout-minutes: 10 env: - GNUMAKEFLAGS: '' + GNUMAKEFLAGS: "" RUN_OPTS: ${{ matrix.run_opts }} - uses: ./.github/actions/slack diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml deleted file mode 100644 index 9892d7e160cf75..00000000000000 --- a/.github/workflows/scorecards.yml +++ /dev/null @@ -1,72 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. They are provided -# by a third-party and are governed by separate terms of service, privacy -# policy, and support documentation. - -name: Scorecards supply-chain security -on: - # For Branch-Protection check. Only the default branch is supported. See - # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection - branch_protection_rule: - # To guarantee Maintained check is occasionally updated. See - # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained - schedule: - - cron: '22 4 * * 2' - # push: - # branches: [ "master" ] - -# Declare default permissions as read only. -permissions: read-all - -jobs: - analysis: - name: Scorecards analysis - runs-on: ubuntu-latest - permissions: - # Needed to upload the results to code-scanning dashboard. - security-events: write - # Needed to publish results and get a badge (see publish_results below). - id-token: write - # Uncomment the permissions below if installing in a private repository. - # contents: read - # actions: read - - steps: - - name: 'Checkout code' - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - with: - persist-credentials: false - - - name: 'Run analysis' - uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0 - with: - results_file: results.sarif - results_format: sarif - # (Optional) Read-only PAT token. Uncomment the `repo_token` line below if: - # - you want to enable the Branch-Protection check on a *public* repository, or - # - you are installing Scorecards on a *private* repository - # To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat. - repo_token: ${{ secrets.SCORECARD_READ_TOKEN }} - - # Public repositories: - # - Publish results to OpenSSF REST API for easy access by consumers - # - Allows the repository to include the Scorecard badge. - # - See https://github.com/ossf/scorecard-action#publishing-results. - # For private repositories: - # - `publish_results` will always be set to `false`, regardless - # of the value entered here. - publish_results: true - - # 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@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 - # with: - # name: SARIF file - # path: results.sarif - # retention-days: 5 - - # Upload the results to GitHub's code scanning dashboard. - - name: 'Upload to code-scanning' - uses: github/codeql-action/upload-sarif@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6 - with: - sarif_file: results.sarif diff --git a/.github/workflows/spec_guards.yml b/.github/workflows/spec_guards.yml deleted file mode 100644 index 321099f024a890..00000000000000 --- a/.github/workflows/spec_guards.yml +++ /dev/null @@ -1,66 +0,0 @@ -name: Rubyspec Version Guards Check - -on: - push: - paths: - - 'spec/**' - - '!spec/*.md' - pull_request: - paths: - - 'spec/**' - - '!spec/*.md' - merge_group: - -concurrency: - group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} - cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} - -permissions: - contents: read - -jobs: - rubyspec: - name: Rubyspec - - runs-on: ubuntu-20.04 - - 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.title, 'Document') - || contains(github.event.pull_request.labels.*.name, 'Documentation') - || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') - )}} - - strategy: - matrix: - # Specs from ruby/spec should still run on all supported Ruby versions. - # This also ensures the needed ruby_version_is guards are there, see spec/README.md. - ruby: - - ruby-3.0 - - ruby-3.1 - - ruby-3.2 - - ruby-3.3 - - steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - - uses: ruby/setup-ruby@a6e6f86333f0a2523ece813039b8b4be04560854 # v1.190.0 - with: - ruby-version: ${{ matrix.ruby }} - bundler: none - - - run: gem install webrick - - - run: ruby ../mspec/bin/mspec - working-directory: spec/ruby - env: - CHECK_LEAKS: true - - - uses: ./.github/actions/slack - with: - label: ${{ matrix.ruby }} - SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot - if: ${{ failure() }} diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 221b2629fafc79..bedaf7184074e8 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -2,12 +2,12 @@ name: Ubuntu on: push: paths-ignore: - - 'doc/**' - - '**/man/*' - - '**.md' - - '**.rdoc' - - '**/.document' - - '.*.yml' + - "doc/**" + - "**/man/*" + - "**.md" + - "**.rdoc" + - "**/.document" + - ".*.yml" pull_request: # Do not use paths-ignore for required status checks # https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks @@ -26,16 +26,16 @@ jobs: matrix: include: - test_task: check - configure: 'cppflags=-DVM_CHECK_MODE' + configure: "cppflags=-DVM_CHECK_MODE" - test_task: check arch: i686 - test_task: check - configure: '--disable-yjit' + configure: "--disable-yjit" - test_task: check - configure: '--enable-shared --enable-load-relative' + configure: "--enable-shared --enable-load-relative" - test_task: check modular_gc: true - configure: '--with-modular-gc=/home/runner/ruby_gc' + configure: "--with-modular-gc=/home/runner/ruby_gc" - test_task: test-bundler-parallel timeout: 50 - test_task: test-bundled-gems @@ -73,7 +73,7 @@ jobs: - uses: ruby/setup-ruby@a6e6f86333f0a2523ece813039b8b4be04560854 # v1.190.0 with: - ruby-version: '3.0' + ruby-version: "3.0" bundler: none - uses: ./.github/actions/setup/directories @@ -131,6 +131,7 @@ jobs: os: ${{ matrix.os || 'ubuntu-22.04' }} test-opts: ${{ matrix.configure }} launchable-token: ${{ secrets.LAUNCHABLE_TOKEN }} + launchable-url: ${{ secrets.LAUNCHABLE_BASE_URL }} builddir: build srcdir: src continue-on-error: true @@ -142,16 +143,16 @@ jobs: ${{ !contains(matrix.test_task, 'bundle') && 'RUBYOPT=-w' || '' }} timeout-minutes: ${{ matrix.timeout || 40 }} env: - RUBY_TESTOPTS: '-q --tty=no' - TEST_BUNDLED_GEMS_ALLOW_FAILURES: 'typeprof' - PRECHECK_BUNDLED_GEMS: 'no' + RUBY_TESTOPTS: "-q --tty=no" + TEST_BUNDLED_GEMS_ALLOW_FAILURES: "typeprof" + PRECHECK_BUNDLED_GEMS: "no" - name: make skipped tests run: | $SETARCH make -s test-all TESTS="${TESTS//-n!\//-n/}" env: - GNUMAKEFLAGS: '' - RUBY_TESTOPTS: '-v --tty=no' + GNUMAKEFLAGS: "" + RUBY_TESTOPTS: "-v --tty=no" if: ${{ matrix.test_task == 'check' && matrix.skipped_tests }} continue-on-error: ${{ matrix.continue-on-skipped_tests || false }} diff --git a/.github/workflows/wasm.yml b/.github/workflows/wasm.yml deleted file mode 100644 index 3924aaeb9905ca..00000000000000 --- a/.github/workflows/wasm.yml +++ /dev/null @@ -1,175 +0,0 @@ -name: WebAssembly -on: - push: - paths-ignore: - - 'doc/**' - - '**/man/*' - - '**.md' - - '**.rdoc' - - '**/.document' - - '.*.yml' - pull_request: - paths-ignore: - - 'doc/**' - - '**/man/*' - - '**.md' - - '**.rdoc' - - '**/.document' - - '.*.yml' - merge_group: - -concurrency: - group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} - cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} - -permissions: # added using https://github.com/step-security/secure-workflows - contents: read - -jobs: - make: - strategy: - matrix: - entry: -# # wasmtime can't compile non-optimized Asyncified binary due to locals explosion -# - { name: O0-debuginfo, optflags: '-O0', debugflags: '-g', wasmoptflags: '-O1' } -# - { name: O1, optflags: '-O1', debugflags: '' , wasmoptflags: '-O1' } - - { name: O2, optflags: '-O2', debugflags: '', wasmoptflags: '-O2' } -# - { name: O3, optflags: '-O3', debugflags: '' , wasmoptflags: '-O3' } -# # -O4 is equivalent to -O3 in clang, but it's different in wasm-opt -# - { name: O4, optflags: '-O3', debugflags: '' , wasmoptflags: '-O4' } -# - { name: Oz, optflags: '-Oz', debugflags: '' , wasmoptflags: '-Oz' } - fail-fast: false - - env: - RUBY_TESTOPTS: '-q --tty=no' - GITPULLOPTIONS: --no-tags origin ${{ github.ref }} - WASI_SDK_VERSION_MAJOR: 20 - WASI_SDK_VERSION_MINOR: 0 - BINARYEN_VERSION: 113 - WASMTIME_VERSION: v15.0.0 - - runs-on: ubuntu-20.04 - - 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.title, 'Document') - || contains(github.event.pull_request.labels.*.name, 'Documentation') - || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]') - )}} - - steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - with: - sparse-checkout-cone-mode: false - sparse-checkout: /.github - - - uses: ./.github/actions/setup/directories - with: - srcdir: src - builddir: build - makeup: true - - - name: Install libraries - run: | - set -ex - sudo apt-get update -q || : - sudo apt-get install --no-install-recommends -q -y ruby make autoconf git wget - - wasi_sdk_deb="wasi-sdk_${WASI_SDK_VERSION_MAJOR}.${WASI_SDK_VERSION_MINOR}_amd64.deb" - wget "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION_MAJOR}/${wasi_sdk_deb}" - sudo dpkg -i "$wasi_sdk_deb" - rm -f "$wasi_sdk_deb" - - mkdir build-sdk - pushd build-sdk - - wasmtime_url="https://github.com/bytecodealliance/wasmtime/releases/download/${WASMTIME_VERSION}/wasmtime-${WASMTIME_VERSION}-x86_64-linux.tar.xz" - wget -O - "$wasmtime_url" | tar xJf - - sudo ln -fs "$PWD/wasmtime-${WASMTIME_VERSION}-x86_64-linux/wasmtime" /usr/local/bin/wasmtime - - binaryen_tarball="binaryen-version_${BINARYEN_VERSION}-x86_64-linux.tar.gz" - binaryen_url="https://github.com/WebAssembly/binaryen/releases/download/version_${BINARYEN_VERSION}/${binaryen_tarball}" - wget -O - "$binaryen_url" | tar xfz - - sudo ln -fs "$PWD/binaryen-version_${BINARYEN_VERSION}/bin/wasm-opt" /usr/local/bin/wasm-opt - working-directory: src - - - name: Set ENV - run: | - echo "WASI_SDK_PATH=/opt/wasi-sdk" >> $GITHUB_ENV - - - uses: ruby/setup-ruby@a6e6f86333f0a2523ece813039b8b4be04560854 # v1.190.0 - with: - ruby-version: '3.0' - bundler: none - - - name: Build baseruby - run: | - set -ex - mkdir ../baseruby - pushd ../baseruby - ../src/configure --prefix=$PWD/install - make - make install - - - name: Run configure - run: | - ../src/configure \ - --host wasm32-unknown-wasi \ - --with-baseruby=$PWD/../baseruby/install/bin/ruby \ - --with-static-linked-ext \ - --with-ext=cgi/escape,continuation,coverage,date,digest/bubblebabble,digest,digest/md5,digest/rmd160,digest/sha1,digest/sha2,etc,fcntl,json,json/generator,json/parser,objspace,pathname,rbconfig/sizeof,ripper,stringio,strscan,monitor \ - LDFLAGS=" \ - -Xlinker --stack-first \ - -Xlinker -z -Xlinker stack-size=16777216 \ - " \ - optflags="${{ matrix.entry.optflags }}" \ - debugflags="${{ matrix.entry.debugflags }}" \ - wasmoptflags="${{ matrix.entry.wasmoptflags }} ${{ matrix.entry.debugflags }}" - - # miniruby may not be built when cross-compling - - run: make mini ruby - - - run: make install DESTDIR=$PWD/../install - - run: tar cfz ../install.tar.gz -C ../install . - - - name: Upload artifacts - uses: actions/upload-artifact@604373da6381bf24206979c74d06a550515601b9 # v4.4.1 - with: - name: ruby-wasm-install - path: ${{ github.workspace }}/install.tar.gz - - name: Show Playground URL to try the build - run: | - echo "Try on Playground: https://ruby.github.io/play-ruby?run=$GITHUB_RUN_ID" >> $GITHUB_STEP_SUMMARY - - - name: Run basictest - run: wasmtime run ./../build/miniruby --mapdir /::./ -- basictest/test.rb - working-directory: src - - - name: Run bootstraptest (no thread) - run: | - NO_THREAD_TESTS="$(grep -L Thread -R ./bootstraptest | awk -F/ '{ print $NF }' | uniq | sed -n 's/test_\(.*\).rb/\1/p' | paste -s -d, -)" - ruby ./bootstraptest/runner.rb --ruby="$(which wasmtime) run $PWD/../build/ruby --mapdir /::./ -- " --verbose "--sets=$NO_THREAD_TESTS" - working-directory: src - - - uses: ./.github/actions/slack - with: - label: ${{ matrix.entry.name }} - SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot - if: ${{ failure() }} - - # Workaround for https://github.com/orgs/community/discussions/25220 - - 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 - if: ${{ github.event_name == 'pull_request' }} - with: - name: github-pr-info - path: ${{ github.workspace }}/github-pr-info.txt - -defaults: - run: - working-directory: build diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 619f9c00af6a5f..f76193b76bcec0 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -2,12 +2,12 @@ name: Windows on: push: paths-ignore: - - 'doc/**' - - '**/man/*' - - '**.md' - - '**.rdoc' - - '**/.document' - - '.*.yml' + - "doc/**" + - "**/man/*" + - "**.md" + - "**.rdoc" + - "**/.document" + - ".*.yml" pull_request: # Do not use paths-ignore for required status checks # https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks @@ -27,7 +27,7 @@ jobs: include: - vc: 2015 vs: 2019 - vcvars: '10.0.14393.0 -vcvars_ver=14.0' # The oldest Windows 10 SDK w/ VC++ 2015 toolset (v140) + vcvars: "10.0.14393.0 -vcvars_ver=14.0" # The oldest Windows 10 SDK w/ VC++ 2015 toolset (v140) test_task: check - vs: 2019 test_task: check @@ -90,7 +90,7 @@ jobs: - uses: ruby/setup-ruby@a6e6f86333f0a2523ece813039b8b4be04560854 # v1.190.0 with: - ruby-version: '3.0' + ruby-version: "3.0" bundler: none windows-toolchain: none @@ -179,8 +179,10 @@ jobs: with: os: windows-${{ matrix.vs < 2022 && '2019' || matrix.vs }} launchable-token: ${{ secrets.LAUNCHABLE_TOKEN }} + launchable-url: ${{ secrets.LAUNCHABLE_BASE_URL }} builddir: build srcdir: src + test-task: ${{ matrix.test_task || 'check' }} continue-on-error: true if: ${{ matrix.test_task != 'test-bundled-gems' }} diff --git a/.github/workflows/yjit-macos.yml b/.github/workflows/yjit-macos.yml index e93981f3792df8..91129546535b72 100644 --- a/.github/workflows/yjit-macos.yml +++ b/.github/workflows/yjit-macos.yml @@ -2,12 +2,12 @@ name: YJIT macOS Arm64 on: push: paths-ignore: - - 'doc/**' - - '**/man/*' - - '**.md' - - '**.rdoc' - - '**/.document' - - '.*.yml' + - "doc/**" + - "**/man/*" + - "**.md" + - "**.rdoc" + - "**/.document" + - ".*.yml" pull_request: # Do not use paths-ignore for required status checks # https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks @@ -54,13 +54,13 @@ jobs: strategy: matrix: include: - - test_task: 'check' - configure: '--enable-yjit' - yjit_opts: '--yjit' - - test_task: 'check' - configure: '--enable-yjit=dev' - yjit_opts: '--yjit-call-threshold=1 --yjit-verify-ctx --yjit-code-gc' - specopts: '-T --yjit-call-threshold=1 -T --yjit-verify-ctx -T --yjit-code-gc' + - test_task: "check" + configure: "--enable-yjit" + yjit_opts: "--yjit" + - test_task: "check" + configure: "--enable-yjit=dev" + yjit_opts: "--yjit-call-threshold=1 --yjit-verify-ctx --yjit-code-gc" + specopts: "-T --yjit-call-threshold=1 -T --yjit-verify-ctx -T --yjit-code-gc" fail-fast: false env: @@ -122,6 +122,7 @@ jobs: os: macos-14 test-opts: ${{ matrix.configure }} launchable-token: ${{ secrets.LAUNCHABLE_TOKEN }} + launchable-url: ${{ secrets.LAUNCHABLE_BASE_URL }} builddir: build srcdir: src continue-on-error: true @@ -133,19 +134,19 @@ jobs: SPECOPTS="$SPECOPTS" timeout-minutes: 60 env: - RUBY_TESTOPTS: '-q --tty=no' - TEST_BUNDLED_GEMS_ALLOW_FAILURES: 'typeprof' - SYNTAX_SUGGEST_TIMEOUT: '5' - PRECHECK_BUNDLED_GEMS: 'no' + RUBY_TESTOPTS: "-q --tty=no" + TEST_BUNDLED_GEMS_ALLOW_FAILURES: "typeprof" + SYNTAX_SUGGEST_TIMEOUT: "5" + PRECHECK_BUNDLED_GEMS: "no" continue-on-error: ${{ matrix.continue-on-test_task || false }} - name: make skipped tests run: | make -s test-all TESTS="${TESTS//-n!\//-n/}" env: - GNUMAKEFLAGS: '' - RUBY_TESTOPTS: '-v --tty=no' - PRECHECK_BUNDLED_GEMS: 'no' + GNUMAKEFLAGS: "" + RUBY_TESTOPTS: "-v --tty=no" + PRECHECK_BUNDLED_GEMS: "no" if: ${{ matrix.test_task == 'check' && matrix.skipped_tests }} continue-on-error: ${{ matrix.continue-on-skipped_tests || false }} diff --git a/.github/workflows/yjit-ubuntu.yml b/.github/workflows/yjit-ubuntu.yml index 7b7ec644a2e75e..c4ad16737f8a55 100644 --- a/.github/workflows/yjit-ubuntu.yml +++ b/.github/workflows/yjit-ubuntu.yml @@ -2,12 +2,12 @@ name: YJIT Ubuntu on: push: paths-ignore: - - 'doc/**' - - '**/man/*' - - '**.md' - - '**.rdoc' - - '**/.document' - - '.*.yml' + - "doc/**" + - "**/man/*" + - "**.md" + - "**.rdoc" + - "**/.document" + - ".*.yml" pull_request: # Do not use paths-ignore for required status checks # https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks @@ -24,7 +24,7 @@ jobs: cargo: name: cargo test - # GitHub Action's image seems to already contain a Rust 1.58.0. + # GitHub Action's image seems to already contain a Rust 1.58.0 runs-on: ubuntu-20.04 if: >- @@ -79,30 +79,30 @@ jobs: fail-fast: false matrix: include: - - test_task: 'yjit-bindgen' - hint: 'To fix: use patch in logs' - configure: '--with-gcc=clang-12 --enable-yjit=dev' + - test_task: "yjit-bindgen" + hint: "To fix: use patch in logs" + configure: "--with-gcc=clang-12 --enable-yjit=dev" - - test_task: 'check' + - test_task: "check" # YJIT should be automatically built in release mode on x86-64 Linux with rustc present #configure: "--enable-yjit RUSTC='rustc +1.58.0'" configure: "RUSTC='rustc +1.58.0'" - rust_version: '1.58.0' + rust_version: "1.58.0" - - test_task: 'check' - configure: '--enable-yjit=dev' + - test_task: "check" + configure: "--enable-yjit=dev" - - test_task: 'check' - configure: '--enable-yjit=dev' - yjit_opts: '--yjit-call-threshold=1 --yjit-verify-ctx --yjit-code-gc' - specopts: '-T --yjit-call-threshold=1 -T --yjit-verify-ctx -T --yjit-code-gc' + - test_task: "check" + configure: "--enable-yjit=dev" + yjit_opts: "--yjit-call-threshold=1 --yjit-verify-ctx --yjit-code-gc" + specopts: "-T --yjit-call-threshold=1 -T --yjit-verify-ctx -T --yjit-code-gc" - - test_task: 'test-bundled-gems' - configure: '--enable-yjit=dev' + - test_task: "test-bundled-gems" + configure: "--enable-yjit=dev" - - test_task: 'yjit-bench' - configure: '--enable-yjit=dev' - yjit_bench_opts: '--yjit-stats' + - test_task: "yjit-bench" + configure: "--enable-yjit=dev" + yjit_bench_opts: "--yjit-stats" continue-on-test_task: true env: @@ -136,7 +136,7 @@ jobs: - uses: ruby/setup-ruby@a6e6f86333f0a2523ece813039b8b4be04560854 # v1.190.0 with: - ruby-version: '3.0' + ruby-version: "3.0" bundler: none - uses: ./.github/actions/setup/directories @@ -165,7 +165,7 @@ jobs: - name: Enable YJIT through ENV run: echo "RUBY_YJIT_ENABLE=1" >> $GITHUB_ENV - # Check that the binary was built with YJIT + # Check that the binary was built with YJI - name: Check YJIT enabled run: ./miniruby --yjit -v | grep "+YJIT" @@ -175,6 +175,7 @@ jobs: os: ubuntu-20.04 test-opts: ${{ matrix.configure }} launchable-token: ${{ secrets.LAUNCHABLE_TOKEN }} + launchable-url: ${{ secrets.LAUNCHABLE_BASE_URL }} builddir: build srcdir: src continue-on-error: true @@ -186,11 +187,11 @@ jobs: YJIT_BENCH_OPTS="$YJIT_BENCH_OPTS" YJIT_BINDGEN_DIFF_OPTS="$YJIT_BINDGEN_DIFF_OPTS" timeout-minutes: 90 env: - RUBY_TESTOPTS: '-q --tty=no' - TEST_BUNDLED_GEMS_ALLOW_FAILURES: 'typeprof' - PRECHECK_BUNDLED_GEMS: 'no' - SYNTAX_SUGGEST_TIMEOUT: '5' - YJIT_BINDGEN_DIFF_OPTS: '--exit-code' + RUBY_TESTOPTS: "-q --tty=no" + TEST_BUNDLED_GEMS_ALLOW_FAILURES: "typeprof" + PRECHECK_BUNDLED_GEMS: "no" + SYNTAX_SUGGEST_TIMEOUT: "5" + YJIT_BINDGEN_DIFF_OPTS: "--exit-code" continue-on-error: ${{ matrix.continue-on-test_task || false }} - name: Show ${{ github.event.pull_request.base.ref }} GitHub URL for yjit-bench comparison