Skip to content

Commit

Permalink
Merge pull request #521 from bkeepers/endoflife-matrix
Browse files Browse the repository at this point in the history
Generate build matrix from endoflife.date
  • Loading branch information
bkeepers authored Dec 13, 2024
2 parents ade0fb3 + fdd83ed commit 79c0f1c
Showing 1 changed file with 29 additions and 3 deletions.
32 changes: 29 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,50 @@ on:
push:
branches: [main]
pull_request:
schedule:
- cron: "0 0 * * *" # Once/day

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: supported
run: |
product="${{ matrix.product }}"
data=$(curl https://endoflife.date/api/$product.json)
supported=$(echo $data | jq '[.[] | select(.eol > (now | strftime("%Y-%m-%d")))]')
echo "${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:
- name: Check out repository code
uses: actions/checkout@v4
- name: Set up Ruby
id: setup-ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: ${{ matrix.ruby }}
continue-on-error: true
- name: Incompatible Versions
if: steps.setup-ruby.outcome == 'failure'
run: echo "Ruby ${{ matrix.ruby }} is not supported with Rails ${{ matrix.rails }}"
- name: Run Rake
if: steps.setup-ruby.outcome != 'failure'
run: bundle exec rake

0 comments on commit 79c0f1c

Please sign in to comment.