Skip to content

Commit

Permalink
Getting Ruby and Rails versions from endoflife.date
Browse files Browse the repository at this point in the history
  • Loading branch information
bkeepers committed Dec 13, 2024
1 parent ade0fb3 commit 5c40b5a
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,33 @@
name: CI
on:
push:
branches: [main]
# branches: [main]
pull_request:
jobs:
versions:
name: Get latest versions
runs-on: ubuntu-latest
strategy:
matrix:
product: [ruby, rails]
outputs:
ruby: ${{ steps.supported.outputs.ruby }}
rails: ${{ steps.supported.outputs.rails }}
steps:
- id: latest
run: |
DATA=$(curl https://endoflife.date/api/${{ matrix.product }}.json)
SUPPORTED=$(echo $DATA | jq '[.[] | select(.eol > (now | strftime("%Y-%m-%d")))]')
echo "${{ matrix.product }}=$(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
name: Test on Ruby ${{ matrix.ruby }} and Rails ${{ matrix.rails }}
strategy:
fail-fast: false
matrix:
ruby: ['3.0', '3.1', '3.2', '3.3']
rails: ['6.1.0', '7.0.0', '7.1.0']
ruby: ${{ fromJSON(needs.versions.outputs.ruby) }}
rails: ${{ fromJSON(needs.versions.outputs.rails) }}
env:
RAILS_VERSION: ${{ matrix.rails }}
steps:
Expand Down

0 comments on commit 5c40b5a

Please sign in to comment.