Skip to content

Commit c9cf41d

Browse files
committed
Update Ruby versions on GHA with ci_versions/all.json
1 parent a9ac9a5 commit c9cf41d

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

.github/workflows/test.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,21 @@ name: test
33
on: [push, pull_request]
44

55
jobs:
6-
build:
6+
ruby-versions:
7+
runs-on: ubuntu-latest
8+
outputs:
9+
versions: ${{ steps.versions.outputs.value }}
10+
steps:
11+
- id: versions
12+
run: |
13+
versions=$(curl -s 'https://cache.ruby-lang.org/pub/misc/ci_versions/all.json' | jq -c '. + ["2.5"]')
14+
echo "::set-output name=value::${versions}"
15+
test:
16+
needs: ruby-versions
717
name: build (${{ matrix.ruby }} / ${{ matrix.os }})
818
strategy:
919
matrix:
10-
ruby: [ '3.0', 2.7, 2.6, 2.5, head ]
20+
ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
1121
os: [ ubuntu-latest, macos-latest ]
1222
runs-on: ${{ matrix.os }}
1323
steps:

0 commit comments

Comments
 (0)