From 3edbbed1c4065e267a64974015ba3c8bbd9c75a8 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Fri, 3 Jun 2022 18:10:43 +0900 Subject: [PATCH] Update Ruby versions on GHA with ci_versions/all.json --- .github/workflows/test.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b844858..9d49d8c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,13 +1,23 @@ -name: build +name: test on: [push, pull_request] jobs: - build: + ruby-versions: + runs-on: ubuntu-latest + outputs: + versions: ${{ steps.versions.outputs.value }} + steps: + - id: versions + run: | + versions=$(curl -s 'https://cache.ruby-lang.org/pub/misc/ci_versions/all.json' | jq -c '. + ["2.5"]') + echo "::set-output name=value::${versions}" + test: + needs: ruby-versions name: build (${{ matrix.ruby }} / ${{ matrix.os }}) strategy: matrix: - ruby: [ '3.0', 2.7, 2.6, 2.5, head ] + ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }} os: [ ubuntu-latest, macos-latest ] runs-on: ${{ matrix.os }} steps: