-
Notifications
You must be signed in to change notification settings - Fork 510
38 lines (38 loc) · 1.07 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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:
needs: versions
runs-on: ubuntu-latest
name: Test on Ruby ${{ matrix.ruby }} and Rails ${{ matrix.rails }}
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