From 5906f6a50ed4c6d3e23595ecf5feea615f0965d5 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 10 Jan 2024 13:47:46 -0500 Subject: [PATCH] Add a GitHub workflow for prism btests --- .github/workflows/prism.yml | 129 ++++++++++++++++++++++++++++++++++++ tool/prism_btests | 35 ++++++++++ 2 files changed, 164 insertions(+) create mode 100644 .github/workflows/prism.yml create mode 100644 tool/prism_btests diff --git a/.github/workflows/prism.yml b/.github/workflows/prism.yml new file mode 100644 index 0000000000..4bfaf92544 --- /dev/null +++ b/.github/workflows/prism.yml @@ -0,0 +1,129 @@ +name: Prism +on: + push: + paths-ignore: + - 'doc/**' + - '**.md' + - '**.rdoc' + - '**/.document' + - '**.[1-8]' + - '**.ronn' + - '.*.yml' + pull_request: + paths-ignore: + - 'doc/**' + - '**.md' + - '**.rdoc' + - '**/.document' + - '**.[1-8]' + - '**.ronn' + - '.*.yml' + merge_group: + paths-ignore: + - 'doc/**' + - '**.md' + - '**.rdoc' + - '**/.document' + - '**.[1-8]' + - '**.ronn' + - '.*.yml' + +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: + # main variables included in the job name + test_task: [check] + run_opts: ['--parser=prism'] + 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: >- + ${{!(false + || contains(github.event.head_commit.message, '[DOC]') + || contains(github.event.pull_request.title, '[DOC]') + || contains(github.event.pull_request.labels.*.name, 'Documentation') + || (github.event_name == 'push' && github.actor == 'dependabot[bot]') + )}} + + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + 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 btest + run: | + make -s btest RUN_OPTS="$RUN_OPTS" BTESTS="$(cat ../src/tool/prism_btests | grep -v '^#' | tr '\n' ' ')" + timeout-minutes: 30 + env: + GNUMAKEFLAGS: '' + RUBY_TESTOPTS: '-v --tty=no' + RUN_OPTS: ${{ matrix.run_opts }} + + # - name: make test + # run: | + # $SETARCH make -s test RUN_OPTS="$RUN_OPTS" + # timeout-minutes: 30 + # env: + # 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" + # timeout-minutes: 40 + # env: + # GNUMAKEFLAGS: '' + # RUBY_TESTOPTS: '-q --tty=no' + # RUN_OPTS: ${{ matrix.run_opts }} + + # - name: make test-spec + # run: | + # $SETARCH make -s test-spec RUN_OPTS="$RUN_OPTS" + # timeout-minutes: 10 + # env: + # GNUMAKEFLAGS: '' + # RUN_OPTS: ${{ matrix.run_opts }} + + - 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/tool/prism_btests b/tool/prism_btests new file mode 100644 index 0000000000..6ce7630153 --- /dev/null +++ b/tool/prism_btests @@ -0,0 +1,35 @@ +../src/bootstraptest/test_attr.rb +../src/bootstraptest/test_autoload.rb +../src/bootstraptest/test_class.rb +../src/bootstraptest/test_constant_cache.rb +../src/bootstraptest/test_env.rb +../src/bootstraptest/test_eval.rb +../src/bootstraptest/test_fiber.rb +../src/bootstraptest/test_finalizer.rb +../src/bootstraptest/test_flip.rb +../src/bootstraptest/test_fork.rb +../src/bootstraptest/test_gc.rb +../src/bootstraptest/test_jump.rb +../src/bootstraptest/test_literal.rb +../src/bootstraptest/test_literal_suffix.rb +../src/bootstraptest/test_load.rb +../src/bootstraptest/test_marshal.rb +../src/bootstraptest/test_objectspace.rb +../src/bootstraptest/test_proc.rb +../src/bootstraptest/test_rjit.rb +../src/bootstraptest/test_string.rb +../src/bootstraptest/test_struct.rb +../src/bootstraptest/test_thread.rb +# ../src/bootstraptest/test_block.rb +# ../src/bootstraptest/test_exception.rb +# ../src/bootstraptest/test_flow.rb +# ../src/bootstraptest/test_insns.rb +# ../src/bootstraptest/test_io.rb +# ../src/bootstraptest/test_massign.rb +# ../src/bootstraptest/test_method.rb +# ../src/bootstraptest/test_ractor.rb +# ../src/bootstraptest/test_syntax.rb +# ../src/bootstraptest/test_yjit.rb +# ../src/bootstraptest/test_yjit_30k_ifelse.rb +# ../src/bootstraptest/test_yjit_30k_methods.rb +# ../src/bootstraptest/test_yjit_rust_port.rb