Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions .github/workflows/ruby-4.0.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Ruby 4.0

permissions:
contents: read

on:
push:
branches:
- 'main'
- '*-stable'
tags:
- '!*' # Do not execute on tags
pull_request:
branches:
- '*'
# Allow manually triggering the workflow.
workflow_dispatch:

# Cancels all previous workflow runs for the same branch that have not yet completed.
concurrency:
# The concurrency group contains the workflow name and the branch name.
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

jobs:
test:
if: "github.event_name != 'push' || (!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]'))"
name: Specs ${{ matrix.ruby }}@${{ matrix.appraisal }}
runs-on: ubuntu-latest
timeout-minutes: 30
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 }}/Appraisal.root.gemfile
# Kill stalled test workers instead of hanging until the CI job timeout.
TURBO_TESTS2_WATCHDOG_SECONDS: 900
strategy:
matrix:
include:
# Ruby 4.0
- ruby: "ruby-4.0"
appraisal: "ruby-4.0"
exec_cmd: "kettle-test"
rubygems: latest
bundler: latest

steps:
- name: Checkout
uses: actions/checkout@3d4.02e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Setup Ruby & RubyGems
uses: appraisal-rb/setup-ruby-flash@6f8ad36ba7488db591541483afb5464d01e8861b # v2.14
with:
ruby-version: ${{ matrix.ruby }}
rubygems: ${{ matrix.rubygems }}
bundler: ${{ matrix.bundler }}
bundler-cache: true
manual-compatibility-bundle: true
gem-install-retries: 7

- name: "[Attempt 1] Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal }}"
id: bundleAppraisalAttempt1
run: bundle exec appraisal ${{ matrix.appraisal }} install
continue-on-error: true

- name: "[Attempt 2] Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal }}"
id: bundleAppraisalAttempt2
if: ${{ steps.bundleAppraisalAttempt1.outcome == 'failure' }}
run: |
rm -f gemfiles/${{ matrix.appraisal }}.gemfile.lock
rm -rf vendor/bundle "$HOME/.bundle/cache"
bundle exec appraisal ${{ matrix.appraisal }} install

- name: Restore RSpec status log
if: "${{!env.ACT}}"
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: .rspec_status
key: rspec-status-ruby-4.0-${{matrix.ruby}}-${{matrix.appraisal}}-${{hashFiles('**/Gemfile.lock','Appraisal.root.gemfile','gemfiles/**/*.gemfile')}}-${{github.run_id}}-${{github.run_attempt}}
restore-keys: |
rspec-status-ruby-4.0-${{matrix.ruby}}-${{matrix.appraisal}}-${{hashFiles('**/Gemfile.lock','Appraisal.root.gemfile','gemfiles/**/*.gemfile')}}-
rspec-status-ruby-4.0-${{matrix.ruby}}-${{matrix.appraisal}}-

- name: Tests for ${{ matrix.ruby }} ${{ matrix.appraisal }} via ${{ matrix.exec_cmd }}
run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }}