|
| 1 | +name: JRuby 10.0 |
| 2 | + |
| 3 | +permissions: |
| 4 | + contents: read |
| 5 | + |
| 6 | +env: |
| 7 | + K_SOUP_COV_DO: false |
| 8 | + |
| 9 | +on: |
| 10 | + push: |
| 11 | + branches: |
| 12 | + - 'main' |
| 13 | + - '*-stable' |
| 14 | + tags: |
| 15 | + - '!*' # Do not execute on tags |
| 16 | + pull_request: |
| 17 | + branches: |
| 18 | + - '*' |
| 19 | + # Allow manually triggering the workflow. |
| 20 | + workflow_dispatch: |
| 21 | + |
| 22 | +# Cancels all previous workflow runs for the same branch that have not yet completed. |
| 23 | +concurrency: |
| 24 | + # The concurrency group contains the workflow name and the branch name. |
| 25 | + group: "${{ github.workflow }}-${{ github.ref }}" |
| 26 | + cancel-in-progress: true |
| 27 | + |
| 28 | +jobs: |
| 29 | + test: |
| 30 | + if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')" |
| 31 | + name: Specs ${{ matrix.ruby }}@${{ matrix.appraisal }} |
| 32 | + runs-on: ubuntu-latest |
| 33 | + continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }} |
| 34 | + env: # $BUNDLE_GEMFILE must be set at job level, so it is set for all steps |
| 35 | + BUNDLE_GEMFILE: ${{ github.workspace }}/Appraisal.root.gemfile |
| 36 | + strategy: |
| 37 | + matrix: |
| 38 | + include: |
| 39 | + # jruby-10.0 (targets Ruby 3.4 compatibility) |
| 40 | + - ruby: "jruby-10.0" |
| 41 | + appraisal: "ruby-3-4" |
| 42 | + exec_cmd: "kettle-test" |
| 43 | + rubygems: default |
| 44 | + bundler: default |
| 45 | + experimental: true |
| 46 | + |
| 47 | + steps: |
| 48 | + - name: Checkout |
| 49 | + if: ${{ !env.ACT }} |
| 50 | + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 |
| 51 | + with: |
| 52 | + persist-credentials: false |
| 53 | + |
| 54 | + - name: Setup Ruby & RubyGems |
| 55 | + if: ${{ !env.ACT }} |
| 56 | + uses: ruby/setup-ruby@89f90524b88a01fe6e0b732220432cc6142926af # v1.313.0 |
| 57 | + with: |
| 58 | + ruby-version: ${{ matrix.ruby }} |
| 59 | + rubygems: ${{ matrix.rubygems }} |
| 60 | + bundler: ${{ matrix.bundler }} |
| 61 | + bundler-cache: true |
| 62 | + |
| 63 | + - name: "[Attempt 1] Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal }}" |
| 64 | + id: bundleAppraisalAttempt1 |
| 65 | + if: ${{ !env.ACT }} |
| 66 | + run: bundle exec appraisal ${{ matrix.appraisal }} install |
| 67 | + # Continue to the next step on failure |
| 68 | + continue-on-error: true |
| 69 | + |
| 70 | + # Effectively an automatic retry of the previous step. |
| 71 | + - name: "[Attempt 2] Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal }}" |
| 72 | + id: bundleAppraisalAttempt2 |
| 73 | + # If bundleAppraisalAttempt1 failed, try again here; Otherwise skip. |
| 74 | + if: ${{ steps.bundleAppraisalAttempt1.outcome == 'failure' && !env.ACT }} |
| 75 | + run: bundle exec appraisal ${{ matrix.appraisal }} install |
| 76 | + |
| 77 | + - name: Tests for ${{ matrix.ruby }} via ${{ matrix.exec_cmd }} |
| 78 | + if: ${{ !env.ACT }} |
| 79 | + run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }} |
0 commit comments