Skip to content

Add latest Rails and Ruby versions to CI #200

Add latest Rails and Ruby versions to CI

Add latest Rails and Ruby versions to CI #200

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
jobs:
versions:
name: Get latest versions
runs-on: ubuntu-latest
outputs:
ruby: ${{ steps.ruby.outputs.latest }}
steps:
- id: ruby
run: |
DATA=$(curl https://endoflife.date/api/ruby.json)
SUPPORTED=$(echo $DATA | jq '[.[] | select(.eol > (now | strftime("%Y-%m-%d")))]')
echo "latest='$(echo $SUPPORTED | jq -c 'map(.latest)')'" >> $GITHUB_OUTPUT
test:
name: Test on Ruby ${{ matrix.ruby }} and Rails ${{ matrix.rails }}
needs: versions
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: ${{fromJSON(needs.versions.outputs.ruby)}}
rails: ["7.0.0", "7.1.0", "7.2.0", "8.0.0"]
env:
RAILS_VERSION: ${{ matrix.rails }}
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: ${{ matrix.ruby }}
- name: Run Rake
run: bundle exec rake