🔧 Setup appraisals #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Ruby - Style | |
on: | |
push: | |
branches: | |
- 'main' | |
tags: | |
- '!*' # Do not execute on tags | |
pull_request: | |
branches: | |
- '*' | |
jobs: | |
rubocop: | |
name: RuboCop | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
# Style | |
- ruby: "3.4" | |
appraisal: "style" | |
exec_cmd: "rake rubocop_gradual:check" | |
gemfile: "Appraisal.root" | |
rubygems: latest | |
bundler: latest | |
runs-on: ubuntu-latest | |
continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }} | |
env: # $BUNDLE_GEMFILE must be set at job level, so it is set for all steps | |
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Ruby & RubyGems | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby }} | |
rubygems: ${{ matrix.rubygems }} | |
bundler: ${{ matrix.bundler }} | |
bundler-cache: false | |
# This will use the BUNDLE_GEMFILE set to matrix.gemfile (i.e. Appraisal.root) | |
# We need to do this first to get appraisal installed. | |
# NOTE: This does not use the root Gemfile at all. | |
- name: Bundle for Appraisal ${{ matrix.appraisal }} | |
run: bundle | |
- name: Install Appraisal ${{ matrix.appraisal }} dependencies | |
run: bundle exec appraisal ${{ matrix.appraisal }} bundle | |
- name: Run ${{ matrix.appraisal }} tests via ${{ matrix.exec_cmd }} | |
run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }} |