diff options
author | 卜部昌平 <shyouhei@ruby-lang.org> | 2023-07-03 22:02:43 +0900 |
---|---|---|
committer | 卜部昌平 <shyouhei@ruby-lang.org> | 2023-07-04 20:13:49 +0900 |
commit | 7690a31223213d11d72a5b44cd40d4455483798f (patch) | |
tree | b15b08d62a3a112560e9ce4a1334c57fad98cc5d /.github | |
parent | f7732d63f4b975cda5463932384b255e85e17642 (diff) |
chore: add blank lines [ci skip]
A bit readable to me.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/8020
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/annocheck.yml | 16 | ||||
-rw-r--r-- | .github/workflows/baseruby.yml | 10 | ||||
-rw-r--r-- | .github/workflows/bundled_gems.yml | 4 | ||||
-rw-r--r-- | .github/workflows/check_dependencies.yml | 11 | ||||
-rw-r--r-- | .github/workflows/check_misc.yml | 8 | ||||
-rw-r--r-- | .github/workflows/cirrus-notify.yml | 5 | ||||
-rw-r--r-- | .github/workflows/compilers.yml | 18 | ||||
-rw-r--r-- | .github/workflows/dependabot_automerge.yml | 4 | ||||
-rw-r--r-- | .github/workflows/macos.yml | 13 | ||||
-rw-r--r-- | .github/workflows/mingw.yml | 5 | ||||
-rw-r--r-- | .github/workflows/rjit-bindgen.yml | 12 | ||||
-rw-r--r-- | .github/workflows/rjit.yml | 12 | ||||
-rw-r--r-- | .github/workflows/spec_guards.yml | 7 | ||||
-rw-r--r-- | .github/workflows/ubuntu.yml | 13 | ||||
-rw-r--r-- | .github/workflows/wasm.yml | 12 | ||||
-rw-r--r-- | .github/workflows/windows.yml | 24 | ||||
-rw-r--r-- | .github/workflows/yjit-ubuntu.yml | 28 |
17 files changed, 202 insertions, 0 deletions
diff --git a/.github/workflows/annocheck.yml b/.github/workflows/annocheck.yml index 0a660f1dea..27f360639b 100644 --- a/.github/workflows/annocheck.yml +++ b/.github/workflows/annocheck.yml @@ -33,11 +33,15 @@ permissions: jobs: compile: name: gcc-11 annocheck + runs-on: ubuntu-latest + container: image: ghcr.io/ruby/ruby-ci-image:gcc-11 options: --user root + if: ${{ !contains(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }} + env: # -g0 disables backtraces when SEGV. Do not set that. debugflags: '-ggdb3' @@ -69,32 +73,44 @@ jobs: steps: - run: id working-directory: + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 with: sparse-checkout-cone-mode: false sparse-checkout: /.github + - uses: ./.github/actions/setup/directories with: srcdir: src builddir: build makeup: true + - name: Run configure run: > ../src/configure -C ${default_configure} ${append_configure} --with-gcc="gcc-11 -fcf-protection -Wa,--generate-missing-build-notes=yes" --enable-shared + - run: make showflags + - run: make + - run: make test + - run: make install + - run: make test-tool + ### test-all doesn't work: https://github.com/ruby/ruby/actions/runs/4340112185/jobs/7578344307 # - run: make test-all TESTS='-- ruby -ext-' + ### test-spec doesn't work: https://github.com/ruby/ruby/actions/runs/4340193212/jobs/7578505652 # - run: make test-spec # env: # CHECK_LEAKS: true + - run: make test-annocheck + - uses: ./.github/actions/slack with: SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot diff --git a/.github/workflows/baseruby.yml b/.github/workflows/baseruby.yml index 75e28e281c..7d461fa809 100644 --- a/.github/workflows/baseruby.yml +++ b/.github/workflows/baseruby.yml @@ -33,8 +33,11 @@ permissions: jobs: baseruby: name: BASERUBY + runs-on: ubuntu-20.04 + if: ${{ !contains(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }} + strategy: matrix: ruby: @@ -50,14 +53,21 @@ jobs: with: ruby-version: ${{ matrix.ruby }} bundler: none + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + - 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 }} diff --git a/.github/workflows/bundled_gems.yml b/.github/workflows/bundled_gems.yml index 38bad88926..dce206ed4d 100644 --- a/.github/workflows/bundled_gems.yml +++ b/.github/workflows/bundled_gems.yml @@ -27,9 +27,13 @@ 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@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 diff --git a/.github/workflows/check_dependencies.yml b/.github/workflows/check_dependencies.yml index b2c3130ea1..29bd489efc 100644 --- a/.github/workflows/check_dependencies.yml +++ b/.github/workflows/check_dependencies.yml @@ -35,20 +35,31 @@ jobs: matrix: os: [ubuntu-20.04] fail-fast: true + runs-on: ${{ matrix.os }} + if: ${{ !contains(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }} + steps: - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + - 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 + - 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: ./.github/actions/slack with: label: ${{ matrix.os }} / Dependencies need to update diff --git a/.github/workflows/check_misc.yml b/.github/workflows/check_misc.yml index d5dfad62e1..acd863ce30 100644 --- a/.github/workflows/check_misc.yml +++ b/.github/workflows/check_misc.yml @@ -12,20 +12,27 @@ jobs: checks: permissions: contents: write # for Git to git push + runs-on: ubuntu-latest + steps: - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + - uses: ./.github/actions/setup/directories + - name: Check if C-sources are US-ASCII run: | grep -r -n '[^ -~]' -- *.[chy] include internal win32/*.[ch] && exit 1 || : + - name: Check for trailing spaces run: | git grep -I -n '[ ]$' -- '*.rb' '*.[chy]' '*.rs' && exit 1 || : git grep -n '^[ ][ ]*$' -- '*.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= @@ -79,6 +86,7 @@ jobs: git diff --color --no-ext-diff --ignore-submodules --exit-code NEWS.md continue-on-error: true if: ${{ steps.gems.outcome == 'success' }} + - name: Commit run: | git pull --ff-only origin ${GITHUB_REF#refs/heads/} diff --git a/.github/workflows/cirrus-notify.yml b/.github/workflows/cirrus-notify.yml index 65868b9d13..a531ee1f2b 100644 --- a/.github/workflows/cirrus-notify.yml +++ b/.github/workflows/cirrus-notify.yml @@ -16,7 +16,9 @@ jobs: && github.event.check_suite.conclusion != 'neutral' && github.event.check_suite.conclusion != 'skipped' && github.event.check_suite.head_branch == 'master' + runs-on: ubuntu-latest + steps: - uses: octokit/request-action@89697eb6635e52c6e1e5559f15b5c91ba5100cb0 # v2.1.9 id: get_failed_check_run @@ -25,14 +27,17 @@ jobs: mediaType: '{"previews": ["antiope"]}' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" + - name: Dump check_runs env: CHECK_RUNS: ${{ steps.get_failed_check_run.outputs.data }} run: echo "$CHECK_RUNS" + - uses: ruby/action-slack@0bd85c72233cdbb6a0fe01d37aaeff1d21b5fce1 # v3.2.1 with: payload: | diff --git a/.github/workflows/compilers.yml b/.github/workflows/compilers.yml index a1824f4582..bb40a665c2 100644 --- a/.github/workflows/compilers.yml +++ b/.github/workflows/compilers.yml @@ -206,27 +206,36 @@ jobs: # - { name: RJIT_FORCE_ENABLE, env: { cppflags: '-DRJIT_FORCE_ENABLE' } } name: ${{ matrix.entry.name }} + runs-on: ubuntu-latest + container: image: ghcr.io/ruby/ruby-ci-image:${{ matrix.entry.container || matrix.entry.env.default_cc || 'clang-16' }} options: --user root + if: ${{ !contains(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }} + env: ${{ matrix.entry.env || matrix.env }} + steps: - run: id working-directory: + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 with: sparse-checkout-cone-mode: false sparse-checkout: /.github + - uses: ./.github/actions/setup/directories with: srcdir: src builddir: build makeup: true + - name: Install Rust if: ${{ matrix.entry.rust }} run: sudo apt-get update && sudo apt install -y rustc + - name: Run configure run: > ../src/configure -C ${default_configure} ${append_configure} @@ -236,22 +245,31 @@ jobs: matrix.entry.crosshost || '"${default_cc}${append_cc:+ $append_cc}"' }} --${{ matrix.entry.shared || 'enable' }}-shared + - name: Add to ext/Setup # statically link just the etc extension run: mkdir ext && echo etc >> ext/Setup if: ${{ matrix.entry.name == 'ext/Setup' }} + - run: make showflags + - run: make + - 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 env: CHECK_LEAKS: true if: ${{ matrix.entry.check }} + - run: make test-annocheck if: ${{ matrix.entry.check && endsWith(matrix.entry.name, 'annocheck') }} diff --git a/.github/workflows/dependabot_automerge.yml b/.github/workflows/dependabot_automerge.yml index 081fbd500f..6259199b11 100644 --- a/.github/workflows/dependabot_automerge.yml +++ b/.github/workflows/dependabot_automerge.yml @@ -6,11 +6,14 @@ on: jobs: automerge: runs-on: ubuntu-latest + if: ${{ github.actor == 'dependabot[bot]' }} + steps: - name: Dependabot metadata uses: dependabot/fetch-metadata@c9c4182bf1b97f5224aee3906fd373f6b61b4526 # v1.6.0 id: metadata + - name: Wait for status checks uses: lewagon/wait-on-check-action@e106e5c43e8ca1edea6383a39a01c5ca495fd812 # v1.3.1 with: @@ -18,6 +21,7 @@ jobs: 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" diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 0cd850f26d..8a2838f24d 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -38,33 +38,44 @@ jobs: - macos-11 - macos-12 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: - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 with: sparse-checkout-cone-mode: false sparse-checkout: /.github + - name: Install libraries uses: ./.github/actions/setup/macos + - uses: ./.github/actions/setup/directories with: srcdir: src builddir: build makeup: true + - name: Set ENV run: | for lib in openssl@1.1 readline; do CONFIGURE_ARGS="${CONFIGURE_ARGS:+$CONFIGURE_ARGS }--with-${lib%@*}-dir=$(brew --prefix $lib)" done echo CONFIGURE_ARGS="${CONFIGURE_ARGS}" >> $GITHUB_ENV + - name: Run configure run: ../src/configure -C --disable-install-doc + - run: make prepare-gems if: ${{ matrix.test_task == 'test-bundled-gems' }} + - run: make + - name: make ${{ matrix.test_task }} run: | make -s ${{ matrix.test_task }} ${TESTS:+TESTS=`echo "$TESTS" | sed 's| |$$/ -n!/|g;s|^|-n!/|;s|$|$$/|'`} @@ -74,6 +85,7 @@ jobs: 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|$|$$/|'` @@ -84,6 +96,7 @@ jobs: PRECHECK_BUNDLED_GEMS: 'no' if: ${{ matrix.test_task == 'check' && matrix.skipped_tests != '' }} continue-on-error: ${{ matrix.continue-on-skipped_tests || false }} + - uses: ./.github/actions/slack with: label: ${{ matrix.test_task }} diff --git a/.github/workflows/mingw.yml b/.github/workflows/mingw.yml index 409e38c9df..2017c478fd 100644 --- a/.github/workflows/mingw.yml +++ b/.github/workflows/mingw.yml @@ -35,7 +35,9 @@ permissions: jobs: make: runs-on: windows-2022 + name: ${{ github.workflow }} (${{ matrix.msystem }}) + env: MSYSTEM: ${{ matrix.msystem }} MSYS2_ARCH: x86_64 @@ -45,6 +47,7 @@ jobs: CPPFLAGS: '-D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048' LDFLAGS: '-pipe' GITPULLOPTIONS: --no-tags origin ${{ github.ref }} + strategy: matrix: include: @@ -54,7 +57,9 @@ jobs: test_task: 'check' test-all-opts: '--name=!/TestObjSpace#test_reachable_objects_during_iteration/' fail-fast: false + if: ${{ !contains(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }} + steps: - name: Set up Ruby & MSYS2 uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939 # v1.152.0 diff --git a/.github/workflows/rjit-bindgen.yml b/.github/workflows/rjit-bindgen.yml index 7a7fe02799..3c8043b9b4 100644 --- a/.github/workflows/rjit-bindgen.yml +++ b/.github/workflows/rjit-bindgen.yml @@ -36,30 +36,42 @@ jobs: include: - task: rjit-bindgen fail-fast: false + runs-on: ubuntu-20.04 + if: ${{ !contains(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }} + steps: - name: Set up Ruby uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939 # v1.152.0 with: ruby-version: '3.1' + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 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 diff --git a/.github/workflows/rjit.yml b/.github/workflows/rjit.yml index 1cd0a8a96f..22aa695709 100644 --- a/.github/workflows/rjit.yml +++ b/.github/workflows/rjit.yml @@ -41,30 +41,39 @@ jobs: run_opts: ['--rjit-call-threshold=1'] arch: [''] 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: ${{ !contains(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }} + steps: - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 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 env: arch: ${{ matrix.arch }} run: >- $SETARCH ../src/configure -C --disable-install-doc cppflags=-DRUBY_DEBUG ${arch:+--target=$arch-$OSTYPE --host=$arch-$OSTYPE} + - run: $SETARCH make + - name: make test run: | $SETARCH make -s test RUN_OPTS="$RUN_OPTS" @@ -73,6 +82,7 @@ jobs: GNUMAKEFLAGS: '' RUBY_TESTOPTS: '-v --tty=no' RUN_OPTS: ${{ matrix.run_opts }} + - name: make test-all run: | $SETARCH make -s test-all RUN_OPTS="$RUN_OPTS" @@ -81,6 +91,7 @@ jobs: GNUMAKEFLAGS: '' RUBY_TESTOPTS: '-v --tty=no' RUN_OPTS: ${{ matrix.run_opts }} + - name: make test-spec run: | $SETARCH make -s test-spec RUN_OPTS="$RUN_OPTS" @@ -88,6 +99,7 @@ jobs: env: GNUMAKEFLAGS: '' RUN_OPTS: ${{ matrix.run_opts }} + - uses: ./.github/actions/slack with: label: ${{ matrix.run_opts }} diff --git a/.github/workflows/spec_guards.yml b/.github/workflows/spec_guards.yml index ad92428c12..79d375c703 100644 --- a/.github/workflows/spec_guards.yml +++ b/.github/workflows/spec_guards.yml @@ -24,8 +24,11 @@ permissions: jobs: rubyspec: name: Rubyspec + runs-on: ubuntu-20.04 + if: ${{ !contains(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. @@ -37,15 +40,19 @@ jobs: steps: - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + - uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939 # v1.152.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 }} diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 77c7fe3c51..7f50e25dfa 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -48,24 +48,31 @@ jobs: - test_task: test-bundler-parallel - test_task: test-bundled-gems fail-fast: false + env: GITPULLOPTIONS: --no-tags origin ${{ github.ref }} RUBY_DEBUG: ci + runs-on: ubuntu-20.04 + if: ${{ !contains(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }} + steps: - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 with: sparse-checkout-cone-mode: false sparse-checkout: /.github + - uses: ./.github/actions/setup/ubuntu with: arch: ${{ matrix.arch }} + - uses: ./.github/actions/setup/directories with: srcdir: src builddir: build makeup: true + - name: Run configure env: arch: ${{ matrix.arch }} @@ -73,13 +80,17 @@ jobs: run: >- $SETARCH ../src/configure -C --disable-install-doc ${configure:-cppflags=-DRUBY_DEBUG} ${arch:+--target=$arch-$OSTYPE --host=$arch-$OSTYPE} + - run: $SETARCH make prepare-gems if: ${{ matrix.test_task == 'test-bundled-gems' }} + - run: $SETARCH make + - 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 }} @@ -91,6 +102,7 @@ jobs: 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|$|$$/|'` @@ -100,6 +112,7 @@ jobs: TESTS: ${{ matrix.skipped_tests }} if: ${{ matrix.test_task == 'check' && matrix.skipped_tests != '' }} continue-on-error: ${{ matrix.continue-on-skipped_tests || false }} + - uses: ./.github/actions/slack with: label: ${{ matrix.test_task }} ${{ matrix.configure }}${{ matrix.arch }} diff --git a/.github/workflows/wasm.yml b/.github/workflows/wasm.yml index 60d1354d6f..e9e6de8de4 100644 --- a/.github/workflows/wasm.yml +++ b/.github/workflows/wasm.yml @@ -43,6 +43,7 @@ jobs: # - { 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 }} @@ -50,18 +51,23 @@ jobs: WASI_SDK_VERSION_MINOR: 0 BINARYEN_VERSION: 109 WASMTIME_VERSION: v0.33.0 + runs-on: ubuntu-20.04 + if: ${{ !contains(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }} + steps: - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 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 @@ -85,9 +91,11 @@ jobs: 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 + - name: Run configure run: | ../src/configure \ @@ -100,16 +108,20 @@ jobs: 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 + - 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.name }} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index bb6a483153..56d53311d3 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -37,9 +37,13 @@ jobs: - vs: 2019 - vs: 2022 fail-fast: false + runs-on: windows-${{ matrix.vs < 2022 && '2019' || matrix.vs }} + if: ${{ !contains(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 }} PATCH: C:\msys64\usr\bin\patch.exe @@ -48,9 +52,11 @@ jobs: # where OpenSSL's default modules directory is incorrectly set to C:\vcpkg\packages\openssl_x64-windows\bin # cf. https://github.com/ruby/openssl/pull/635#issuecomment-1596833720 OPENSSL_MODULES: C:\vcpkg\installed\x64-windows\bin + steps: - run: md build working-directory: + - uses: msys2/setup-msys2@d40200dc2db4c351366b048a9565ad82919e1c24 # v2 id: setup-msys2 with: @@ -58,10 +64,12 @@ jobs: install: >- patch if: ${{ env.OS_VER != 'windows-2019' }} + - name: patch path shell: msys2 {0} run: echo PATCH=$(cygpath -wa $(command -v patch)) >> $GITHUB_ENV if: ${{ steps.setup-msys2.outcome == 'success' }} + - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 with: path: C:\vcpkg\downloads @@ -69,6 +77,7 @@ jobs: restore-keys: | ${{ runner.os }}-vcpkg-download-${{ env.OS_VER }}- ${{ runner.os }}-vcpkg-download- + - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 with: path: C:\vcpkg\installed @@ -76,22 +85,27 @@ jobs: restore-keys: | ${{ runner.os }}-vcpkg-installed-${{ matrix.os }}- ${{ runner.os }}-vcpkg-installed- + - name: Install libraries with vcpkg run: | vcpkg --triplet x64-windows install libffi libyaml openssl readline zlib + - name: Install libraries with scoop run: | iex "& {$(irm get.scoop.sh)} -RunAsAdmin" Join-Path (Resolve-Path ~).Path "scoop\shims" >> $Env:GITHUB_PATH shell: pwsh + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 with: sparse-checkout-cone-mode: false sparse-checkout: /.github + - uses: ./.github/actions/setup/directories with: srcdir: src builddir: build + - 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 @@ -110,8 +124,10 @@ jobs: set | C:\msys64\usr\bin\sort > new.env C:\msys64\usr\bin\comm -13 old.env new.env >> %GITHUB_ENV% del *.env + - name: compiler version run: cl + - name: link libraries run: | for %%I in (C:\vcpkg\installed\x64-windows\bin\*.dll) do ( @@ -120,21 +136,29 @@ jobs: 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 --with-opt-dir=C:/vcpkg/installed/x64-windows + - run: nmake incs + - run: nmake extract-extlibs + - run: nmake + - run: nmake test timeout-minutes: 5 + - run: nmake test-spec MSPECOPT="-V -fspec" timeout-minutes: 10 + - run: nmake test-all env: RUBY_TESTOPTS: -j${{ env.TEST_JOBS }} --job-status=normal timeout-minutes: 60 + - uses: ./.github/actions/slack with: label: VS${{ matrix.vs }} / ${{ matrix.test_task || 'check' }} diff --git a/.github/workflows/yjit-ubuntu.yml b/.github/workflows/yjit-ubuntu.yml index d550d78c68..b273fd6ac3 100644 --- a/.github/workflows/yjit-ubuntu.yml +++ b/.github/workflows/yjit-ubuntu.yml @@ -32,30 +32,41 @@ permissions: jobs: cargo: name: Rust cargo test + # GitHub Action's image seems to already contain a Rust 1.58.0. runs-on: ubuntu-20.04 + steps: - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + # For now we can't run cargo test --offline because it complains about the # capstone dependency, even though the dependency is optional #- run: cargo test --offline + - run: RUST_BACKTRACE=1 cargo test working-directory: yjit + # Also compile and test with all features enabled - run: RUST_BACKTRACE=1 cargo test --all-features working-directory: yjit + # Check that we can build in release mode too - run: cargo build --release working-directory: yjit + lint: name: Rust lint + # GitHub Action's image seems to already contain a Rust 1.58.0. runs-on: ubuntu-20.04 + steps: - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + # Check that we don't have linting errors in release mode, too - run: cargo clippy --all-targets --all-features working-directory: yjit + make: strategy: fail-fast: false @@ -87,6 +98,7 @@ jobs: - test_task: 'yjit-bench' configure: '--enable-yjit=dev' yjit_bench_opts: '--yjit-stats' + env: GITPULLOPTIONS: --no-tags origin ${{ github.ref }} RUN_OPTS: ${{ matrix.yjit_opts }} @@ -94,37 +106,51 @@ jobs: RUBY_DEBUG: ci BUNDLE_JOBS: 8 # for yjit-bench RUST_BACKTRACE: 1 + runs-on: ubuntu-20.04 + if: ${{ !contains(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }} + steps: - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 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: Install Rust if: ${{ matrix.rust_version }} run: rustup install ${{ matrix.rust_version }} --profile minimal + - name: Run configure run: ../src/configure -C --disable-install-doc --prefix=$(pwd)/install ${{ matrix.configure }} + - run: make incs + - run: make prepare-gems if: ${{ matrix.test_task == 'test-bundled-gems' }} + - run: make + - 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 + # Check that the binary was built with YJIT - name: Check YJIT enabled run: ./miniruby --yjit -v | grep "+YJIT" + - name: make ${{ matrix.test_task }} run: make -s -j ${{ matrix.test_task }} RUN_OPTS="$RUN_OPTS" YJIT_BENCH_OPTS="$YJIT_BENCH_OPTS" timeout-minutes: 60 @@ -134,12 +160,14 @@ jobs: PRECHECK_BUNDLED_GEMS: 'no' SYNTAX_SUGGEST_TIMEOUT: '5' continue-on-error: ${{ matrix.test_task == 'yjit-bench' }} + - name: Show ${{ github.event.pull_request.base.ref }} GitHub URL for yjit-bench comparison run: echo "https://github.com/${BASE_REPO}/commit/${BASE_SHA}" env: BASE_REPO: ${{ github.event.pull_request.base.repo.full_name }} BASE_SHA: ${{ github.event.pull_request.base.sha }} if: ${{ matrix.test_task == 'yjit-bench' && startsWith(github.event_name, 'pull') }} + - uses: ./.github/actions/slack with: label: ${{ matrix.test_task }} ${{ matrix.configure }} |