|
| 1 | +# Targets the evergreen latest release of ruby, truffleruby, and jruby |
| 2 | +name: Current |
| 3 | + |
| 4 | +env: |
| 5 | + K_SOUP_COV_DO: false |
| 6 | + |
| 7 | +on: |
| 8 | + push: |
| 9 | + branches: |
| 10 | + - 'main' |
| 11 | + tags: |
| 12 | + - '!*' # Do not execute on tags |
| 13 | + pull_request: |
| 14 | + branches: |
| 15 | + - '*' |
| 16 | + # Allow manually triggering the workflow. |
| 17 | + workflow_dispatch: |
| 18 | + |
| 19 | +permissions: |
| 20 | + contents: read |
| 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 | + name: Specs - Ruby ${{ matrix.ruby }} ${{ matrix.appraisal }}${{ matrix.name_extra || '' }} |
| 31 | + if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')" |
| 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 }}/${{ matrix.gemfile }}.gemfile |
| 36 | + strategy: |
| 37 | + matrix: |
| 38 | + include: |
| 39 | + |
| 40 | + - ruby: "ruby" |
| 41 | + appraisal: "ruby-current" |
| 42 | + exec_cmd: "rake spec" |
| 43 | + gemfile: "Appraisal.root" |
| 44 | + rubygems: latest |
| 45 | + bundler: latest |
| 46 | + |
| 47 | + - ruby: "truffleruby" |
| 48 | + appraisal: "ruby-current" |
| 49 | + exec_cmd: "rake spec" |
| 50 | + gemfile: "Appraisal.root" |
| 51 | + rubygems: default |
| 52 | + bundler: default |
| 53 | + |
| 54 | + - ruby: "jruby" |
| 55 | + appraisal: "ruby-current" |
| 56 | + exec_cmd: "rake spec" |
| 57 | + gemfile: "Appraisal.root" |
| 58 | + rubygems: default |
| 59 | + bundler: default |
| 60 | + |
| 61 | + steps: |
| 62 | + - name: Checkout |
| 63 | + uses: actions/checkout@v4 |
| 64 | + |
| 65 | + - name: Setup Ruby & RubyGems |
| 66 | + uses: ruby/setup-ruby@v1 |
| 67 | + with: |
| 68 | + ruby-version: ${{ matrix.ruby }} |
| 69 | + rubygems: ${{ matrix.rubygems }} |
| 70 | + bundler: ${{ matrix.bundler }} |
| 71 | + bundler-cache: false |
| 72 | + |
| 73 | + # Raw `bundle` will use the BUNDLE_GEMFILE set to matrix.gemfile (i.e. Appraisal.root) |
| 74 | + # We need to do this first to get appraisal installed. |
| 75 | + # NOTE: This does not use the main Gemfile at all. |
| 76 | + - name: Bundle install for Appraisal ${{ matrix.appraisal }} |
| 77 | + run: bundle |
| 78 | + - name: Install Appraisal ${{ matrix.appraisal }} dependencies |
| 79 | + run: bundle exec appraisal ${{ matrix.appraisal }} bundle |
| 80 | + - name: Run ${{ matrix.appraisal }} tests via ${{ matrix.exec_cmd }} |
| 81 | + run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }} |
0 commit comments