diff options
Diffstat (limited to '.github')
| -rw-r--r-- | .github/SECURITY.md | 9 | ||||
| -rw-r--r-- | .github/codeql/codeql-config.yml | 3 | ||||
| -rw-r--r-- | .github/workflows/baseruby.yml | 65 | ||||
| -rw-r--r-- | .github/workflows/check_dependencies.yml | 64 | ||||
| -rw-r--r-- | .github/workflows/codeql-analysis.yml | 61 | ||||
| -rw-r--r-- | .github/workflows/compilers.yml | 245 | ||||
| -rw-r--r-- | .github/workflows/macos.yml | 98 | ||||
| -rw-r--r-- | .github/workflows/mingw.yml | 160 | ||||
| -rw-r--r-- | .github/workflows/mjit.yml | 97 | ||||
| -rw-r--r-- | .github/workflows/publish.yml | 18 | ||||
| -rw-r--r-- | .github/workflows/spec_guards.yml | 52 | ||||
| -rw-r--r-- | .github/workflows/ubuntu.yml | 130 | ||||
| -rw-r--r-- | .github/workflows/windows.yml | 140 | ||||
| -rw-r--r-- | .github/workflows/yjit-ubuntu.yml | 113 | ||||
| -rw-r--r-- | .github/workflows/yjit_asm_tests.yml | 38 |
15 files changed, 1293 insertions, 0 deletions
diff --git a/.github/SECURITY.md b/.github/SECURITY.md new file mode 100644 index 0000000000..56baa29942 --- /dev/null +++ b/.github/SECURITY.md @@ -0,0 +1,9 @@ +# Security Policy + +## Supported Versions + +See <https://www.ruby-lang.org/en/downloads/branches/>. + +## Reporting a Vulnerability + +See <https://www.ruby-lang.org/en/security/>. diff --git a/.github/codeql/codeql-config.yml b/.github/codeql/codeql-config.yml new file mode 100644 index 0000000000..91f82b842b --- /dev/null +++ b/.github/codeql/codeql-config.yml @@ -0,0 +1,3 @@ +name: "CodeQL config for the Ruby language" + +languages: cpp diff --git a/.github/workflows/baseruby.yml b/.github/workflows/baseruby.yml new file mode 100644 index 0000000000..b0f6695cfe --- /dev/null +++ b/.github/workflows/baseruby.yml @@ -0,0 +1,65 @@ +name: BASERUBY Check + +on: + push: + paths-ignore: + - 'doc/**' + - '**.md' + - '**.rdoc' + pull_request: + paths-ignore: + - 'doc/**' + - '**.md' + - '**.rdoc' + +concurrency: + group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} + cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} + +jobs: + baseruby: + name: BASERUBY + runs-on: ubuntu-20.04 + if: ${{ !startsWith(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }} + strategy: + matrix: + ruby: + - ruby-2.2 +# - ruby-2.3 +# - ruby-2.4 +# - ruby-2.5 +# - ruby-2.6 + - ruby-2.7 + - ruby-3.0 + + steps: + - uses: actions/checkout@v3 + - uses: actions/cache@v4 + with: + path: .downloaded-cache + key: downloaded-cache + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler: none + - run: echo "GNUMAKEFLAGS=-j$((1 + $(nproc --all)))" >> $GITHUB_ENV + - run: sudo apt-get install build-essential autoconf bison + - run: ./autogen.sh + - run: ./configure --disable-install-doc + - run: make common-srcs + - run: make incs + - run: make all + - run: make test + - uses: k0kubun/action-slack@v2.0.0 + with: + payload: | + { + "ci": "GitHub Actions", + "env": "${{ github.workflow }} / BASERUBY @ ${{ matrix.ruby }}", + "url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}", + "commit": "${{ github.sha }}", + "branch": "${{ github.ref }}".split('/').reverse()[0] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot + if: ${{ failure() && github.event_name == 'push' }} diff --git a/.github/workflows/check_dependencies.yml b/.github/workflows/check_dependencies.yml new file mode 100644 index 0000000000..1ca3929d31 --- /dev/null +++ b/.github/workflows/check_dependencies.yml @@ -0,0 +1,64 @@ +name: Check Dependencies +on: + push: + paths-ignore: + - 'doc/**' + - '**.md' + - '**.rdoc' + pull_request: + paths-ignore: + - 'doc/**' + - '**.md' + - '**.rdoc' + +concurrency: + group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} + cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} + +jobs: + update-deps: + strategy: + matrix: + os: [ubuntu-20.04] + fail-fast: true + runs-on: ${{ matrix.os }} + if: ${{ !startsWith(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }} + steps: + - name: Install libraries + run: | + set -x + sudo apt-get update -q || : + sudo apt-get install --no-install-recommends -q -y build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev bison autoconf ruby + if: ${{ contains(matrix.os, 'ubuntu') }} + - name: Install libraries + run: | + brew install gmp libffi openssl@1.1 zlib autoconf automake libtool readline + if: ${{ contains(matrix.os, 'macos') }} + - name: git config + run: | + git config --global advice.detachedHead 0 + git config --global init.defaultBranch garbage + - uses: actions/checkout@v3 + - uses: actions/cache@v4 + with: + path: .downloaded-cache + key: downloaded-cache + - run: ./autogen.sh + - 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: ruby tool/update-deps --fix + - run: git diff --no-ext-diff --ignore-submodules --exit-code + - uses: k0kubun/action-slack@v2.0.0 + with: + payload: | + { + "ci": "GitHub Actions", + "env": "${{ matrix.os }} / Dependencies need to update", + "url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}", + "commit": "${{ github.sha }}", + "branch": "${{ github.ref }}".split('/').reverse()[0] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot + if: ${{ failure() && github.event_name == 'push' }} diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000000..b07796f3d7 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,61 @@ +name: "Code scanning - action" + +on: + push: + paths-ignore: + - 'doc/**' + - '**.md' + - '**.rdoc' + pull_request: + paths-ignore: + - 'doc/**' + - '**.md' + - '**.rdoc' + schedule: + - cron: '0 12 * * 4' + +concurrency: + group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} + cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} + +jobs: + CodeQL-Build: + + # CodeQL runs on ubuntu-latest and windows-latest + runs-on: ubuntu-latest + if: ${{ !startsWith(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }} + + env: + enable_install_doc: no + + steps: + - name: Install libraries + run: | + set -x + sudo apt-get update -q || : + sudo apt-get install --no-install-recommends -q -y build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev bison autoconf ruby + + - name: Checkout repository + uses: actions/checkout@v3 + + - uses: actions/cache@v4 + with: + path: .downloaded-cache + key: downloaded-cache + + - name: Remove an obsolete rubygems vendored file + run: sudo rm /usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb + + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + config-file: ./.github/codeql/codeql-config.yml + + - name: Set ENV + run: echo "GNUMAKEFLAGS=-j$((1 + $(nproc --all)))" >> $GITHUB_ENV + + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/compilers.yml b/.github/workflows/compilers.yml new file mode 100644 index 0000000000..2c6aed1d2a --- /dev/null +++ b/.github/workflows/compilers.yml @@ -0,0 +1,245 @@ +name: Compilations + +on: + push: + paths-ignore: + - 'doc/**' + - '**.md' + - '**.rdoc' + pull_request: + paths-ignore: + - 'doc/**' + - '**.md' + - '**.rdoc' + +concurrency: + group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} + cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} + +# Github actions does not support YAML anchors. This creative use of +# environment variables (plus the "echo $GITHUB_ENV" hack) is to reroute that +# restriction. +env: + default_cc: clang-14 + append_cc: '' + crosshost: '' + + # -O1 is faster than -O3 in our tests... Majority of time are consumed trying + # to optimize binaries. Also Github Actions run on relatively modern CPUs + # compared to, say, GCC 4 or Clang 3. We don't specify `-march=native` + # because compilers tend not understand what the CPU is. + optflags: '-O1' + + # -g0 disables backtraces when SEGV. Do not set that. + debugflags: '-ggdb3' + + default_configure: >- + --enable-debug-env + --disable-install-doc + --with-ext=-test-/cxxanyargs,+ + append_configure: >- + --without-valgrind + --without-jemalloc + --without-gmp + + UPDATE_UNICODE: >- + UNICODE_FILES=. + UNICODE_PROPERTY_FILES=. + UNICODE_AUXILIARY_FILES=. + UNICODE_EMOJI_FILES=. + CONFIGURE_TTY: never + GITPULLOPTIONS: --no-tags origin ${{github.ref}} + RUBY_DEBUG: ci rgengc + RUBY_TESTOPTS: >- + -q + --color=always + --tty=no + +jobs: + compile: + strategy: + fail-fast: false + matrix: + entry: + - { key: default_cc, name: gcc-11, value: gcc-11, container: gcc-11 } + - { key: default_cc, name: gcc-10, value: gcc-10, container: gcc-10 } + - { key: default_cc, name: gcc-9, value: gcc-9, container: gcc-9 } + - { key: default_cc, name: gcc-8, value: gcc-8, container: gcc-8 } + - { key: default_cc, name: gcc-7, value: gcc-7, container: gcc-7 } +# - { key: default_cc, name: gcc-6, value: gcc-6, container: gcc-6 } +# - { key: default_cc, name: gcc-5, value: gcc-5, container: gcc-5 } +# - { key: default_cc, name: gcc-4.8, value: gcc-4.8, container: gcc-4.8 } + - key: default_cc + name: 'gcc-11 LTO' + value: 'gcc-11 -O2 -flto=auto -ffat-lto-objects' + container: gcc-11 + shared: '--disable-shared' + # check: true + - { key: default_cc, name: clang-14, value: clang-14, container: clang-14 } + - { key: default_cc, name: clang-13, value: clang-13, container: clang-13 } + - { key: default_cc, name: clang-12, value: clang-12, container: clang-12 } + - { key: default_cc, name: clang-11, value: clang-11, container: clang-11 } + - { key: default_cc, name: clang-10, value: clang-10, container: clang-10 } + - { key: default_cc, name: clang-9, value: clang-9, container: clang-9 } + - { key: default_cc, name: clang-8, value: clang-8, container: clang-8 } + - { key: default_cc, name: clang-7, value: clang-7, container: clang-7 } + - { key: default_cc, name: clang-6.0, value: clang-6.0, container: clang-6.0 } +# - { key: default_cc, name: clang-5.0, value: clang-5.0, container: clang-5.0 } +# - { key: default_cc, name: clang-4.0, value: clang-4.0, container: clang-4.0 } +# - { key: default_cc, name: clang-3.9, value: clang-3.9, container: clang-3.9 } + - key: default_cc + name: 'clang-14 LTO' + value: 'clang-14 -O2 -flto=auto' + container: clang-14 + shared: '--disable-shared' + # check: true + + - { key: crosshost, name: aarch64-linux-gnu, value: aarch64-linux-gnu, container: crossbuild-essential-arm64 } +# - { key: crosshost, name: arm-linux-gnueabi, value: arm-linux-gnueabi } +# - { key: crosshost, name: arm-linux-gnueabihf, value: arm-linux-gnueabihf } +# - { key: crosshost, name: i686-w64-mingw32, value: i686-w64-mingw32 } +# - { key: crosshost, name: powerpc-linux-gnu, value: powerpc-linux-gnu } + - { key: crosshost, name: powerpc64le-linux-gnu, value: powerpc64le-linux-gnu, container: crossbuild-essential-ppc64el } + - { key: crosshost, name: s390x-linux-gnu, value: s390x-linux-gnu, container: crossbuild-essential-s390x } + - { key: crosshost, name: x86_64-w64-mingw32, value: x86_64-w64-mingw32, container: mingw-w64 } + +# - { key: append_cc, name: c99, value: '-std=c99 -Werror=pedantic -pedantic-errors' } +# - { key: append_cc, name: c11, value: '-std=c11 -Werror=pedantic -pedantic-errors' } +# - { key: append_cc, name: c17, value: '-std=c17 -Werror=pedantic -pedantic-errors' } +# - { key: append_cc, name: c2x, value: '-std=c2x -Werror=pedantic -pedantic-errors' } + - { key: CXXFLAGS, name: c++98, value: '-std=c++98 -Werror=pedantic -pedantic-errors -Wno-c++11-long-long' } +# - { key: CXXFLAGS, name: c++11, value: '-std=c++11 -Werror=pedantic -pedantic-errors -Wno-c++11-long-long' } +# - { key: CXXFLAGS, name: c++14, value: '-std=c++14 -Werror=pedantic -pedantic-errors -Wno-c++11-long-long' } +# - { key: CXXFLAGS, name: c++17, value: '-std=c++17 -Werror=pedantic -pedantic-errors -Wno-c++11-long-long' } + - { key: CXXFLAGS, name: c++2a, value: '-std=c++2a -Werror=pedantic -pedantic-errors -Wno-c++11-long-long' } + + - { key: optflags, name: '-O0', value: '-O0 -march=x86-64 -mtune=generic' } +# - { key: optflags, name: '-O3', value: '-O3 -march=x86-64 -mtune=generic', check: true } + + - { key: append_configure, name: gmp, value: '--with-gmp' } + - { key: append_configure, name: jemalloc, value: '--with-jemalloc' } + - { key: append_configure, name: valgrind, value: '--with-valgrind' } + - { key: append_configure, name: 'coroutine=ucontext', value: '--with-coroutine=ucontext' } + - { key: append_configure, name: 'coroutine=pthread', value: '--with-coroutine=pthread' } + - { key: append_configure, name: disable-jit-support, value: '--disable-jit-support' } + - { key: append_configure, name: disable-dln, value: '--disable-dln' } + - { key: append_configure, name: disable-rubygems, value: '--disable-rubygems' } + + - { key: cppflags, name: OPT_THREADED_CODE=1, value: '-DOPT_THREADED_CODE=1' } + - { key: cppflags, name: OPT_THREADED_CODE=2, value: '-DOPT_THREADED_CODE=2' } + - { key: cppflags, name: OPT_THREADED_CODE=3, value: '-DOPT_THREADED_CODE=3' } + + - { key: cppflags, name: NDEBUG, value: '-DNDEBUG' } + - { key: cppflags, name: RUBY_DEBUG, value: '-DRUBY_DEBUG' } +# - { key: cppflags, name: ARRAY_DEBUG, value: '-DARRAY_DEBUG' } +# - { key: cppflags, name: BIGNUM_DEBUG, value: '-DBIGNUM_DEBUG' } +# - { key: cppflags, name: CCAN_LIST_DEBUG, value: '-DCCAN_LIST_DEBUG' } +# - { key: cppflags, name: CPDEBUG=-1, value: '-DCPDEBUG=-1' } +# - { key: cppflags, name: ENC_DEBUG, value: '-DENC_DEBUG' } +# - { key: cppflags, name: GC_DEBUG, value: '-DGC_DEBUG' } +# - { key: cppflags, name: HASH_DEBUG, value: '-DHASH_DEBUG' } +# - { key: cppflags, name: ID_TABLE_DEBUG, value: '-DID_TABLE_DEBUG' } +# - { key: cppflags, name: RGENGC_DEBUG=-1, value: '-DRGENGC_DEBUG=-1' } +# - { key: cppflags, name: SYMBOL_DEBUG, value: '-DSYMBOL_DEBUG' } +# - { key: cppflags, name: THREAD_DEBUG=-1, value: '-DTHREAD_DEBUG=-1' } + +# - { key: cppflags, name: RGENGC_CHECK_MODE, value: '-DRGENGC_CHECK_MODE' } +# - { key: cppflags, name: TRANSIENT_HEAP_CHECK_MODE, value: '-DTRANSIENT_HEAP_CHECK_MODE' } +# - { key: cppflags, name: VM_CHECK_MODE, value: '-DVM_CHECK_MODE' } + + - { key: cppflags, name: USE_EMBED_CI=0, value: '-DUSE_EMBED_CI=0' } + - { key: cppflags, name: USE_FLONUM=0, value: '-DUSE_FLONUM=0' } +# - { key: cppflags, name: USE_GC_MALLOC_OBJ_INFO_DETAILS, value: '-DUSE_GC_MALLOC_OBJ_INFO_DETAILS' } + - { key: cppflags, name: USE_LAZY_LOAD, value: '-DUSE_LAZY_LOAD' } +# - { key: cppflags, name: USE_RINCGC=0, value: '-DUSE_RINCGC=0' } +# - { key: cppflags, name: USE_SYMBOL_GC=0, value: '-DUSE_SYMBOL_GC=0' } +# - { key: cppflags, name: USE_THREAD_CACHE=0, value: '-DUSE_THREAD_CACHE=0' } +# - { key: cppflags, name: USE_TRANSIENT_HEAP=0, value: '-DUSE_TRANSIENT_HEAP=0' } +# - { key: cppflags, name: USE_RUBY_DEBUG_LOG=1, value: '-DUSE_RUBY_DEBUG_LOG=1' } + + - { key: cppflags, name: DEBUG_FIND_TIME_NUMGUESS, value: '-DDEBUG_FIND_TIME_NUMGUESS' } + - { key: cppflags, name: DEBUG_INTEGER_PACK, value: '-DDEBUG_INTEGER_PACK' } +# - { key: cppflags, name: ENABLE_PATH_CHECK, value: '-DENABLE_PATH_CHECK' } + + - { key: cppflags, name: GC_DEBUG_STRESS_TO_CLASS, value: '-DGC_DEBUG_STRESS_TO_CLASS' } +# - { key: cppflags, name: GC_ENABLE_LAZY_SWEEP=0, value: '-DGC_ENABLE_LAZY_SWEEP=0' } +# - { key: cppflags, name: GC_PROFILE_DETAIL_MEMOTY, value: '-DGC_PROFILE_DETAIL_MEMOTY' } +# - { key: cppflags, name: GC_PROFILE_MORE_DETAIL, value: '-DGC_PROFILE_MORE_DETAIL' } + +# - { key: cppflags, name: CALC_EXACT_MALLOC_SIZE, value: '-DCALC_EXACT_MALLOC_SIZE' } +# - { key: cppflags, name: MALLOC_ALLOCATED_SIZE_CHECK, value: '-DMALLOC_ALLOCATED_SIZE_CHECK' } + +# - { key: cppflags, name: IBF_ISEQ_ENABLE_LOCAL_BUFFER, value: '-DIBF_ISEQ_ENABLE_LOCAL_BUFFER' } + +# - { key: cppflags, name: RGENGC_ESTIMATE_OLDMALLOC, value: '-DRGENGC_ESTIMATE_OLDMALLOC' } +# - { key: cppflags, name: RGENGC_FORCE_MAJOR_GC, value: '-DRGENGC_FORCE_MAJOR_GC' } +# - { key: cppflags, name: RGENGC_OBJ_INFO, value: '-DRGENGC_OBJ_INFO' } +# - { key: cppflags, name: RGENGC_OLD_NEWOBJ_CHECK, value: '-DRGENGC_OLD_NEWOBJ_CHECK' } +# - { key: cppflags, name: RGENGC_PROFILE, value: '-DRGENGC_PROFILE' } + +# - { key: cppflags, name: VM_DEBUG_BP_CHECK, value: '-DVM_DEBUG_BP_CHECK' } +# - { key: cppflags, name: VM_DEBUG_VERIFY_METHOD_CACHE, value: '-DVM_DEBUG_VERIFY_METHOD_CACHE' } + + - { key: cppflags, name: MJIT_FORCE_ENABLE, value: '-DMJIT_FORCE_ENABLE' } + - { key: cppflags, name: YJIT_FORCE_ENABLE, value: '-DYJIT_FORCE_ENABLE' } + + name: ${{ matrix.entry.name }} + runs-on: ubuntu-latest + container: + image: ghcr.io/ruby/ruby-ci-image:${{ matrix.entry.container || 'clang-14' }} + options: --user root + if: ${{ !startsWith(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }} + steps: + - run: id + working-directory: + - run: mkdir build + working-directory: + - name: setenv + run: | + echo "${{ matrix.entry.key }}=${{ matrix.entry.value }}" >> $GITHUB_ENV + echo "GNUMAKEFLAGS=-sj$((1 + $(nproc --all)))" >> $GITHUB_ENV + - uses: actions/checkout@v3 + with: + path: src + - uses: actions/cache@v4 + with: + path: src/.downloaded-cache + key: downloaded-cache + - run: ./autogen.sh + working-directory: src + - name: Run configure + run: > + ../src/configure -C ${default_configure} ${append_configure} + ${{ matrix.entry.key == 'crosshost' && '--host="${crosshost}"' || '--with-gcc="${default_cc} ${append_cc}"' }} + ${{ matrix.entry.shared || '--enable-shared' }} + - run: make extract-extlibs + - run: make incs + - run: make + - run: make leaked-globals + - run: make test + - run: make install + if: ${{ matrix.entry.check }} + - run: make test-tool + if: ${{ matrix.entry.check }} + - run: make test-all TESTS='-- ruby -ext-' + if: ${{ matrix.entry.check }} + - run: make test-spec + if: ${{ matrix.entry.check }} + + - uses: k0kubun/action-slack@v2.0.0 + with: + payload: | + { + "ci": "GitHub Actions", + "env": "${{ github.workflow }} / ${{ matrix.entry.name }}", + "url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}", + "commit": "${{ github.sha }}", + "branch": "${{ github.ref }}".split('/').reverse()[0] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot + if: ${{ failure() && github.event_name == 'push' }} + +defaults: + run: + working-directory: build diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml new file mode 100644 index 0000000000..83f5e6addc --- /dev/null +++ b/.github/workflows/macos.yml @@ -0,0 +1,98 @@ +name: macOS +on: + push: + paths-ignore: + - 'doc/**' + - '**.md' + - '**.rdoc' + pull_request: + paths-ignore: + - 'doc/**' + - '**.md' + - '**.rdoc' + +concurrency: + group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} + cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} + +jobs: + make: + strategy: + matrix: + test_task: ["check"] # "test-bundler-parallel", "test-bundled-gems" + os: + - macos-13 + - macos-14 + - macos-15 + fail-fast: false + env: + GITPULLOPTIONS: --no-tags origin ${{github.ref}} + runs-on: ${{ matrix.os }} + if: ${{ !contains(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }} + steps: + - run: mkdir build + working-directory: + - name: git config + run: | + git config --global advice.detachedHead 0 + git config --global init.defaultBranch garbage + - uses: actions/checkout@v3 + with: + path: src + - uses: actions/cache@v4 + with: + path: src/.downloaded-cache + key: downloaded-cache + - name: Install libraries + run: | + brew install gmp libffi openssl@1.1 zlib autoconf automake libtool readline + working-directory: src + - name: Set ENV + run: | + echo "MAKEFLAGS=-j$((1 + $(sysctl -n hw.activecpu)))" >> $GITHUB_ENV + - run: ./autogen.sh + working-directory: src + - name: Run configure + run: ../src/configure -C --disable-install-doc --with-openssl-dir=$(brew --prefix openssl@1.1) --with-readline-dir=$(brew --prefix readline) + - run: make incs + - run: make prepare-gems + if: ${{ matrix.test_task == 'test-bundled-gems' }} + - run: make + - run: make leaked-globals + if: ${{ matrix.test_task == 'check' }} + - name: make ${{ matrix.test_task }} + run: | + make -s ${{ matrix.test_task }} ${TESTS:+TESTS=`echo "$TESTS" | sed 's| |$$/ -n!/|g;s|^|-n!/|;s|$|$$/|'`} + timeout-minutes: 40 + env: + RUBY_TESTOPTS: "-q --tty=no" + TESTS: ${{ matrix.test_task == 'check' && matrix.skipped_tests || '' }} + TEST_BUNDLED_GEMS_ALLOW_FAILURES: "" + PRECHECK_BUNDLED_GEMS: "no" + - name: make skipped tests + run: | + make -s test-all TESTS=`echo "$TESTS" | sed 's| |$$/ -n/|g;s|^|-n/|;s|$|$$/|'` + env: + GNUMAKEFLAGS: "" + RUBY_TESTOPTS: "-v --tty=no" + TESTS: ${{ matrix.skipped_tests }} + PRECHECK_BUNDLED_GEMS: "no" + if: ${{ matrix.test_task == 'check' && matrix.skipped_tests != '' }} + continue-on-error: ${{ matrix.continue-on-skipped_tests || false }} + - uses: k0kubun/action-slack@v2.0.0 + with: + payload: | + { + "ci": "GitHub Actions", + "env": "${{ matrix.os }} / ${{ matrix.test_task }}${{ matrix.configure }}", + "url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}", + "commit": "${{ github.sha }}", + "branch": "${{ github.ref }}".split('/').reverse()[0] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot + if: ${{ failure() && github.event_name == 'push' }} + +defaults: + run: + working-directory: build diff --git a/.github/workflows/mingw.yml b/.github/workflows/mingw.yml new file mode 100644 index 0000000000..49a4439d2e --- /dev/null +++ b/.github/workflows/mingw.yml @@ -0,0 +1,160 @@ +name: MinGW +on: + push: + paths-ignore: + - 'doc/**' + - '**.md' + - '**.rdoc' + pull_request: + paths-ignore: + - 'doc/**' + - '**.md' + - '**.rdoc' + +concurrency: + group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} + cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} + +# Notes: +# Actions console encoding causes issues, see test-all & test-spec steps +# +jobs: + make: + runs-on: windows-2022 + name: ${{ github.workflow }} (${{ matrix.msystem }}) + env: + MSYSTEM: ${{ matrix.msystem }} + MSYS2_ARCH: x86_64 + CHOST: "x86_64-w64-mingw32" + CFLAGS: "-march=x86-64 -mtune=generic -O3 -pipe -fstack-protector-strong" + CXXFLAGS: "-march=x86-64 -mtune=generic -O3 -pipe" + CPPFLAGS: "-D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048" + LDFLAGS: "-pipe -fstack-protector-strong" + UPDATE_UNICODE: "UNICODE_FILES=. UNICODE_PROPERTY_FILES=. UNICODE_AUXILIARY_FILES=. UNICODE_EMOJI_FILES=." + GITPULLOPTIONS: --no-tags origin ${{github.ref}} + strategy: + matrix: + include: + # To mitigate flakiness of MinGW CI, we test only one runtime that newer MSYS2 uses. + - msystem: "UCRT64" + base_ruby: head + test_task: [ "check" ] # to make job names consistent + fail-fast: false + if: ${{ !startsWith(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }} + steps: + - run: mkdir build + working-directory: + - name: git config + run: | + git config --global core.autocrlf false + git config --global core.eol lf + git config --global advice.detachedHead 0 + git config --global init.defaultBranch garbage + - uses: actions/checkout@v3 + with: + path: src + - uses: actions/cache@v4 + with: + path: src/.downloaded-cache + key: downloaded-cache + - name: Set up Ruby & MSYS2 + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.base_ruby }} + - name: set env + run: | + echo "GNUMAKEFLAGS=-j$((2 * NUMBER_OF_PROCESSORS))" >> $GITHUB_ENV + echo "TEST_JOBS=$((15 * NUMBER_OF_PROCESSORS / 10))" >> $GITHUB_ENV + + - name: where check + run: | + # show where + mv /c/Windows/System32/libcrypto-1_1-x64.dll /c/Windows/System32/libcrypto-1_1-x64.dll_ + mv /c/Windows/System32/libssl-1_1-x64.dll /c/Windows/System32/libssl-1_1-x64.dll_ + result=true + for e in gcc.exe ragel.exe make.exe bison.exe libcrypto-1_1-x64.dll libssl-1_1-x64.dll; do + echo '##['group']'$'\033[93m'$e$'\033[m' + where $e || result=false + echo '##['endgroup']' + done + $result + + - name: version check + run: | + # show version + result=true + for e in gcc ragel make bison "openssl version"; do + case "$e" in *" "*) ;; *) e="$e --version";; esac + echo '##['group']'$'\033[93m'$e$'\033[m' + $e || result=false + echo '##['endgroup']' + done + $result + + - name: autogen + run: | + ./autogen.sh + working-directory: src + + - name: configure + run: > + ../src/configure --disable-install-doc --prefix=/. + --build=$CHOST --host=$CHOST --target=$CHOST + + - name: update + run: | + make incs + + - name: download gems + run: | + make update-gems + + - name: make all + timeout-minutes: 20 + run: | + make + + - run: make leaked-globals + + - name: make install + run: | + make DESTDIR=../install install-nodoc + + - name: test + timeout-minutes: 5 + run: | + make test + + - name: test-all + timeout-minutes: 45 + run: | + # Actions uses UTF8, causes test failures, similar to normal OS setup + chcp.com 437 + make test-all + env: + RUBY_TESTOPTS: -j${{env.TEST_JOBS}} --retry --job-status=normal --show-skip --timeout-scale=1.5 + BUNDLER_VERSION: + + - name: test-spec + timeout-minutes: 10 + run: | + make test-spec + + - uses: k0kubun/action-slack@v2.0.0 + with: + payload: | + { + "ci": "GitHub Actions", + "env": "${{ github.workflow }} / ${{ matrix.test_task }}", + "url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}", + "commit": "${{ github.sha }}", + "branch": "${{ github.ref }}".split('/').reverse()[0] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot + if: ${{ failure() && github.event_name == 'push' }} + +defaults: + run: + working-directory: build + shell: sh diff --git a/.github/workflows/mjit.yml b/.github/workflows/mjit.yml new file mode 100644 index 0000000000..659c57d1fa --- /dev/null +++ b/.github/workflows/mjit.yml @@ -0,0 +1,97 @@ +name: MJIT +on: + push: + paths-ignore: + - 'doc/**' + - '**.md' + - '**.rdoc' + pull_request: + paths-ignore: + - 'doc/**' + - '**.md' + - '**.rdoc' + +concurrency: + group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} + cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} + +jobs: + make: + strategy: + matrix: + test_task: [ "check" ] # to make job names consistent + jit_opts: [ "--mjit", "--mjit-wait" ] + fail-fast: false + runs-on: ubuntu-latest + if: ${{ !startsWith(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }} + env: + TESTOPTS: '-q --tty=no' + RUN_OPTS: '--disable-gems ${{ matrix.jit_opts }} --mjit-debug=-ggdb3' + GITPULLOPTIONS: --no-tags origin ${{github.ref}} + steps: + - run: mkdir build + working-directory: + - name: Install libraries + run: | + set -x + sudo apt-get update -q || : + sudo apt-get install --no-install-recommends -q -y build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev bison autoconf ruby + - name: git config + run: | + git config --global advice.detachedHead 0 + git config --global init.defaultBranch garbage + - uses: actions/checkout@v3 + with: + path: src + - uses: actions/cache@v4 + with: + path: src/.downloaded-cache + key: downloaded-cache + - name: Fixed world writable dirs + run: | + chmod -v go-w $HOME $HOME/.config + sudo chmod -R go-w /usr/share + sudo bash -c 'IFS=:; for d in '"$PATH"'; do chmod -v go-w $d; done' || : + - name: Set ENV + run: | + echo "GNUMAKEFLAGS=-j$((1 + $(nproc --all)))" >> $GITHUB_ENV + - run: ./autogen.sh + working-directory: src + - name: Run configure + run: ../src/configure -C --disable-install-doc cppflags=-DVM_CHECK_MODE + - run: make incs + - run: make + - run: sudo make -s install + - run: sudo apt-get install gdb # used by test / test-all failure + - name: Run test + run: | + ulimit -c unlimited + make -s test RUN_OPTS="$RUN_OPTS" + timeout-minutes: 60 + - name: Run test-all + run: | + ulimit -c unlimited + make -s test-all RUN_OPTS="$RUN_OPTS" + timeout-minutes: 60 + - name: Run test-spec + run: | + ulimit -c unlimited + make -s test-spec RUN_OPTS="$RUN_OPTS" + timeout-minutes: 60 + - uses: k0kubun/action-slack@v2.0.0 + with: + payload: | + { + "ci": "GitHub Actions", + "env": "${{ github.workflow }} / ${{ matrix.test_task }} ${{ matrix.jit_opts }}", + "url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}", + "commit": "${{ github.sha }}", + "branch": "${{ github.ref }}".split('/').reverse()[0] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot + if: ${{ failure() && github.event_name == 'push' }} + +defaults: + run: + working-directory: build diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000000..5d4474d978 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,18 @@ +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/spec_guards.yml b/.github/workflows/spec_guards.yml new file mode 100644 index 0000000000..c47d70806b --- /dev/null +++ b/.github/workflows/spec_guards.yml @@ -0,0 +1,52 @@ +name: Rubyspec Version Guards Check + +on: + push: + paths-ignore: + - 'doc/**' + - '**.md' + - '**.rdoc' + pull_request: + paths-ignore: + - 'doc/**' + - '**.md' + - '**.rdoc' + +concurrency: + group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} + cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} + +jobs: + rubyspec: + name: Rubyspec + runs-on: ubuntu-20.04 + if: ${{ !startsWith(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }} + 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.1 + + steps: + - uses: actions/checkout@v3 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler: none + - run: gem install webrick + - run: ruby ../mspec/bin/mspec + working-directory: spec/ruby + - uses: k0kubun/action-slack@v2.0.0 + with: + payload: | + { + "ci": "GitHub Actions", + "env": "${{ github.workflow }} / rubyspec @ ${{ matrix.ruby }}", + "url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}", + "commit": "${{ github.sha }}", + "branch": "${{ github.ref }}".split('/').reverse()[0] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot + if: ${{ failure() && github.event_name == 'push' }} diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml new file mode 100644 index 0000000000..c249f1db16 --- /dev/null +++ b/.github/workflows/ubuntu.yml @@ -0,0 +1,130 @@ +name: Ubuntu +on: + push: + paths-ignore: + - 'doc/**' + - '**.md' + - '**.rdoc' + pull_request: + paths-ignore: + - 'doc/**' + - '**.md' + - '**.rdoc' + +concurrency: + group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} + cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} + +jobs: + make: + strategy: + matrix: + test_task: ["check", "test-bundler-parallel", "test-bundled-gems"] + os: + - ubuntu-20.04 +# - ubuntu-18.04 + configure: ["", "cppflags=-DRUBY_DEBUG"] + include: + - test_task: "check" + os: ubuntu-20.04 + configure: "--host=i686-$OSTYPE" + - test_task: "test-all TESTS=--repeat-count=2" + os: ubuntu-20.04 + configure: "" + fail-fast: false + env: + GITPULLOPTIONS: --no-tags origin ${{github.ref}} + RUBY_DEBUG: ci + runs-on: ${{ matrix.os }} + if: ${{ !startsWith(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }} + steps: + - run: mkdir build + working-directory: + - name: Set ENV + env: + configure: ${{matrix.configure}} + run: | + echo "GNUMAKEFLAGS=-j$((1 + $(nproc --all)))" >> $GITHUB_ENV + arch=`echo " $configure" | sed '/.* --host=/!d;s///;s/[- ].*//'` + echo "SETARCH=${arch:+setarch $arch}" >> $GITHUB_ENV + - name: Install libraries + run: | + set -x + arch="${SETARCH##* }" + arch=${arch:+:${arch/i[3-6]86/i386}} + ${arch:+sudo dpkg --add-architecture ${arch#:}} + sudo apt-get update -q || : + sudo apt-get install --no-install-recommends -q -y \ + ${arch:+cross}build-essential${arch/:/-} \ + libssl-dev${arch} libyaml-dev${arch} libreadline6-dev${arch} \ + zlib1g-dev${arch} libncurses5-dev${arch} libffi-dev${arch} \ + bison autoconf ruby + sudo apt-get install -q -y pkg-config${arch} || : + - name: git config + run: | + git config --global advice.detachedHead 0 + git config --global init.defaultBranch garbage + - uses: actions/checkout@v3 + with: + path: src + - uses: actions/cache@v4 + with: + path: src/.downloaded-cache + key: downloaded-cache + - name: Fixed world writable dirs + run: | + chmod -v go-w $HOME $HOME/.config + sudo chmod -R go-w /usr/share + sudo bash -c 'IFS=:; for d in '"$PATH"'; do chmod -v go-w $d; done' || : + - run: ./autogen.sh + working-directory: src + - name: Run configure + env: + arch: ${{matrix.arch}} + run: >- + $SETARCH ../src/configure -C --disable-install-doc ${{ matrix.configure }} + ${arch:+--target=$arch-$OSTYPE} + - run: $SETARCH make incs + - run: $SETARCH make prepare-gems + if: ${{ matrix.test_task == 'test-bundled-gems' }} + - run: $SETARCH make + - run: $SETARCH make leaked-globals + if: ${{ matrix.test_task == 'check' }} + - name: Create dummy files in build dir + run: | + $SETARCH ./miniruby -e '(("a".."z").to_a+("A".."Z").to_a+("0".."9").to_a+%w[foo bar test zzz]).each{|basename|File.write("#{basename}.rb", "raise %(do not load #{basename}.rb)")}' + if: ${{ matrix.test_task == 'check' }} + - name: make ${{ matrix.test_task }} + run: | + $SETARCH make -s ${{ matrix.test_task }} ${TESTS:+TESTS=`echo "$TESTS" | sed 's| |$/ -n!/|g;s|^|-n!/|;s|$|$$/|'`} + timeout-minutes: 40 + env: + RUBY_TESTOPTS: "-q --tty=no" + TESTS: ${{ matrix.test_task == 'check' && matrix.skipped_tests || '' }} + TEST_BUNDLED_GEMS_ALLOW_FAILURES: "" + PRECHECK_BUNDLED_GEMS: "no" + - name: make skipped tests + run: | + $SETARCH make -s test-all TESTS=`echo "$TESTS" | sed 's| |$/ -n/|g;s|^|-n/|;s|$|$$/|'` + env: + GNUMAKEFLAGS: "" + RUBY_TESTOPTS: "-v --tty=no" + TESTS: ${{ matrix.skipped_tests }} + if: ${{ matrix.test_task == 'check' && matrix.skipped_tests != '' }} + - uses: k0kubun/action-slack@v2.0.0 + with: + payload: | + { + "ci": "GitHub Actions", + "env": "${{ matrix.os }} / ${{ matrix.test_task }}${{ matrix.configure }}", + "url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}", + "commit": "${{ github.sha }}", + "branch": "${{ github.ref }}".split('/').reverse()[0] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot + if: ${{ failure() && github.event_name == 'push' }} + +defaults: + run: + working-directory: build diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 0000000000..4cab958e8c --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,140 @@ +name: Windows +on: + push: + paths-ignore: + - 'doc/**' + - '**.md' + - '**.rdoc' + pull_request: + paths-ignore: + - 'doc/**' + - '**.md' + - '**.rdoc' + +concurrency: + group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} + cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} + +jobs: + make: + strategy: + matrix: + include: + - vs: 2019 + os: windows-2019 + vcvars: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"' + # - vs: 2022 + # os: windows-2022 + # vcvars: '"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"' + fail-fast: false + runs-on: ${{ matrix.os }} + if: ${{ !startsWith(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }} + name: VisualStudio ${{ matrix.vs }} + env: + GITPULLOPTIONS: --no-tags origin ${{github.ref}} + VCVARS: ${{ matrix.vcvars }} + PATCH: C:\msys64\usr\bin\patch.exe + VCPKG_DEFAULT_TRIPLET: ${{ matrix.target || 'x64' }}-windows + steps: + - run: md build + working-directory: + - uses: msys2/setup-msys2@v2 + id: setup-msys2 + with: + update: true + install: bison patch + - name: patch path + shell: msys2 {0} + run: echo PATCH=$(cygpath -wa $(command -v patch)) >> $GITHUB_ENV + if: ${{ steps.setup-msys2.outcome == 'success' }} + - name: Export GitHub Actions cache environment variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + - name: Install libraries with scoop + run: | + iex "& {$(irm get.scoop.sh)} -RunAsAdmin" + Join-Path (Resolve-Path ~).Path "scoop\shims" >> $Env:GITHUB_PATH + scoop install vcpkg + shell: pwsh + - name: git config + run: | + git config --global core.autocrlf false + git config --global core.eol lf + git config --global advice.detachedHead 0 + git config --global init.defaultBranch garbage + - uses: actions/checkout@v3 + with: + path: src + - uses: actions/cache@v4 + with: + path: src/.downloaded-cache + key: downloaded-cache + - name: Install libraries with vcpkg + run: | + vcpkg install + working-directory: src + env: + VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" + - name: setup env + # %TEMP% is inconsistent with %TMP% and test-all expects they are consistent. + # https://github.com/actions/virtual-environments/issues/712#issuecomment-613004302 + # msys2/setup-msys2 installs MSYS2 to D:/a/_temp/msys64/usr/bin + run: | + set Path=D:/a/_temp/msys64/usr/bin;%Path% + set | C:\msys64\usr\bin\sort > old.env + call %VCVARS% + set TMP=%USERPROFILE%\AppData\Local\Temp + set TEMP=%USERPROFILE%\AppData\Local\Temp + set /a TEST_JOBS=(15 * %NUMBER_OF_PROCESSORS% / 10) > nul + set | C:\msys64\usr\bin\sort > new.env + C:\msys64\usr\bin\comm -13 old.env new.env >> %GITHUB_ENV% + del *.env + - name: link libraries + run: | + for %%I in (D:\a\ruby\ruby\src\vcpkg_installed\%VCPKG_DEFAULT_TRIPLET%\bin\*.dll) do ( + if not %%~nI == readline mklink %%~nxI %%I + ) + for %%I in (libcrypto-1_1-x64 libssl-1_1-x64) do ( + ren c:\Windows\System32\%%I.dll %%I.dll_ + ) + - name: Configure + run: >- + ../src/win32/configure.bat --disable-install-doc + --enable-bundled-libffi + --with-opt-dir=D:/a/ruby/ruby/src/vcpkg_installed/%VCPKG_DEFAULT_TRIPLET% + - run: nmake incs + - run: nmake extract-extlibs + - run: nmake + env: + YACC: bison.exe + - run: nmake test + timeout-minutes: 5 + - run: nmake test-all + env: + RUBY_TESTOPTS: -j${{env.TEST_JOBS}} --job-status=normal + timeout-minutes: 60 + continue-on-error: ${{ matrix.continue-on-error || false }} + - run: nmake test-spec + timeout-minutes: 10 + continue-on-error: ${{ matrix.continue-on-error || false }} + - uses: k0kubun/action-slack@v2.0.0 + with: + payload: | + { + "ci": "GitHub Actions", + "env": "VS${{ matrix.vs }} / ${{ matrix.test_task || 'check' }}", + "url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}", + "commit": "${{ github.sha }}", + "branch": "${{ github.ref }}".split('/').reverse()[0] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot + if: ${{ failure() && github.event_name == 'push' }} + +defaults: + run: + working-directory: build + shell: cmd diff --git a/.github/workflows/yjit-ubuntu.yml b/.github/workflows/yjit-ubuntu.yml new file mode 100644 index 0000000000..aeb719098a --- /dev/null +++ b/.github/workflows/yjit-ubuntu.yml @@ -0,0 +1,113 @@ +name: YJIT Ubuntu +on: + push: + paths-ignore: + - 'doc/**' + - '**.md' + - '**.rdoc' + pull_request: + paths-ignore: + - 'doc/**' + - '**.md' + - '**.rdoc' + +concurrency: + group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} + cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} + +jobs: + make: + strategy: + matrix: + test_task: ["check"] # "test-bundler-parallel", + os: + - ubuntu-20.04 +# - ubuntu-18.04 + yjit_opts: [ + "--yjit", + "--yjit --yjit-call-threshold=1", + ] + configure: ["", "cppflags=-DRUBY_DEBUG"] + include: + - test_task: "test-all TESTS=--repeat-count=2" + os: ubuntu-20.04 + configure: "" + yjit_enable_env: RUBY_YJIT_ENABLE + - test_task: "test-bundled-gems" + os: ubuntu-20.04 + configure: "cppflags=-DRUBY_DEBUG" + yjit_enable_env: RUBY_YJIT_ENABLE + fail-fast: false + env: + GITPULLOPTIONS: --no-tags origin ${{github.ref}} + RUN_OPTS: ${{ matrix.yjit_opts }} + RUBY_DEBUG: ci + runs-on: ${{ matrix.os }} + if: ${{ !startsWith(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }} + steps: + - run: mkdir build + working-directory: + - name: Install libraries + run: | + set -x + sudo apt-get update -q || : + sudo apt-get install --no-install-recommends -q -y build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev bison autoconf ruby + - name: git config + run: | + git config --global advice.detachedHead 0 + git config --global init.defaultBranch garbage + - uses: actions/checkout@v3 + with: + path: src + - uses: actions/cache@v4 + with: + path: src/.downloaded-cache + key: downloaded-cache + - name: Fixed world writable dirs + run: | + chmod -v go-w $HOME $HOME/.config + sudo chmod -R go-w /usr/share + sudo bash -c 'IFS=:; for d in '"$PATH"'; do chmod -v go-w $d; done' || : + - name: Set ENV + run: | + echo "GNUMAKEFLAGS=-j$((1 + $(nproc --all)))" >> $GITHUB_ENV + - run: ./autogen.sh + working-directory: src + - name: Run configure + run: ../src/configure -C --disable-install-doc ${{ matrix.configure }} + - run: make incs + - run: make prepare-gems + if: ${{ matrix.test_task == 'test-bundled-gems' }} + - run: make + - run: make leaked-globals + if: ${{ matrix.test_task == 'check' }} + - name: Create dummy files in build dir + run: | + ./miniruby -e '(("a".."z").to_a+("A".."Z").to_a+("0".."9").to_a+%w[foo bar test zzz]).each{|basename|File.write("#{basename}.rb", "raise %(do not load #{basename}.rb)")}' + if: ${{ matrix.test_task == 'check' }} + - name: Enable YJIT through ENV + run: echo "RUBY_YJIT_ENABLE=1" >> $GITHUB_ENV + if: ${{ matrix.yjit_enable_env }} + - run: make -s ${{ matrix.test_task }} RUN_OPTS="$RUN_OPTS" + timeout-minutes: 60 + env: + RUBY_TESTOPTS: "-q --tty=no" + TEST_BUNDLED_GEMS_ALLOW_FAILURES: "" + PRECHECK_BUNDLED_GEMS: "no" + - uses: k0kubun/action-slack@v2.0.0 + with: + payload: | + { + "ci": "GitHub Actions", + "env": "${{ matrix.os }} / ${{ matrix.test_task }}${{ matrix.configure }}", + "url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}", + "commit": "${{ github.sha }}", + "branch": "${{ github.ref }}".split('/').reverse()[0] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot + if: ${{ failure() && github.event_name == 'push' }} + +defaults: + run: + working-directory: build diff --git a/.github/workflows/yjit_asm_tests.yml b/.github/workflows/yjit_asm_tests.yml new file mode 100644 index 0000000000..a7e05066dd --- /dev/null +++ b/.github/workflows/yjit_asm_tests.yml @@ -0,0 +1,38 @@ +name: YJIT x86 assembler tests + +on: + push: + paths-ignore: + - 'doc/**' + - '**.md' + - '**.rdoc' + pull_request: + paths-ignore: + - 'doc/**' + - '**.md' + - '**.rdoc' + +concurrency: + group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} + cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} + +jobs: + test: + runs-on: ubuntu-latest + if: ${{ !startsWith(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }} + steps: + - name: Install dependencies + run: | + set -x + sudo apt-get update -q || : + sudo apt-get install --no-install-recommends -q -y build-essential + - name: git config + run: | + git config --global advice.detachedHead 0 + git config --global init.defaultBranch garbage + - uses: actions/checkout@v3 + with: + path: src + - name: Run ASM tests + run: ./misc/test_yjit_asm.sh + working-directory: src |
