From 609cacaba46a839248cf1066de945491fe16e176 Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Mon, 8 Jan 2024 09:14:52 +0100 Subject: [PATCH 1/3] CI: Use shared versions GH Actions workflow I took some inspiration from https://github.com/ruby/uri/blob/master/.github/workflows/test.yml and then I edited the necessary values. --- .github/workflows/ci.yml | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6f6bed4d97..0af2e3eca0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,35 +5,28 @@ on: - pull_request jobs: + ruby-versions: + uses: ruby/actions/.github/workflows/ruby_versions.yml@master + with: + min_version: 2.4 + host: - name: ${{ matrix.os }} ${{ matrix.ruby }} + needs: ruby-versions + name: build (${{ matrix.ruby }} / ${{ matrix.os }}) runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: + ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }} os: - ubuntu-latest - macos-latest - windows-latest - ruby: - - '2.4' - - '2.5' - - '2.6' - - '2.7' - - '3.0' - - '3.1' - - '3.2' - - debug - # We need to update 'jruby-XXX' in "if:" too when we update - # this. - - jruby-9.4.1.0 - - truffleruby - - truffleruby-head include: - { os: windows-latest , ruby: mingw } - { os: windows-latest , ruby: mswin } exclude: - - { os: windows-latest , ruby: debug } + - { os: windows-latest , ruby: head } - { os: windows-latest , ruby: truffleruby } - { os: windows-latest , ruby: truffleruby-head } @@ -52,7 +45,7 @@ jobs: # "gem install pkg/*.gem" fails. - run: bundle exec rake version:bump if: >- - matrix.ruby == 'debug' || + matrix.ruby == 'head' || matrix.ruby == 'mingw' || matrix.ruby == 'mswin' @@ -61,7 +54,7 @@ jobs: - uses: actions/upload-artifact@v4 if: >- matrix.os == 'ubuntu-latest' && - (matrix.ruby == '3.1' || matrix.ruby == 'jruby-9.4.1.0') + (matrix.ruby == '3.3' || matrix.ruby == 'jruby-9.4.5.0') with: name: gem-${{ matrix.os }}-${{ matrix.ruby }} path: pkg/ @@ -70,7 +63,7 @@ jobs: if: >- startsWith(github.ref, 'refs/tags/') && matrix.os == 'ubuntu-latest' && - (matrix.ruby == '3.1' || matrix.ruby == 'jruby-9.4.1.0') + (matrix.ruby == '3.3' || matrix.ruby == 'jruby-9.4.5.0') run: | ruby \ -e 'print("## strscan "); \ From 17065314c01615a0994517b43b203114f13b8871 Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Mon, 8 Jan 2024 09:34:23 +0100 Subject: [PATCH 2/3] CI: refer to "latest jruby" as jruby We now use the versions workflow. This means that that value is fixed, this YAML file needing no further updates. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0af2e3eca0..722908f8ff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,7 +54,7 @@ jobs: - uses: actions/upload-artifact@v4 if: >- matrix.os == 'ubuntu-latest' && - (matrix.ruby == '3.3' || matrix.ruby == 'jruby-9.4.5.0') + (matrix.ruby == '3.3' || matrix.ruby == 'jruby') with: name: gem-${{ matrix.os }}-${{ matrix.ruby }} path: pkg/ @@ -63,7 +63,7 @@ jobs: if: >- startsWith(github.ref, 'refs/tags/') && matrix.os == 'ubuntu-latest' && - (matrix.ruby == '3.3' || matrix.ruby == 'jruby-9.4.5.0') + (matrix.ruby == '3.3' || matrix.ruby == 'jruby') run: | ruby \ -e 'print("## strscan "); \ From 5059537c0b27c8a556d9b2482e0ffffcafc1e8bd Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Mon, 8 Jan 2024 16:58:58 +0100 Subject: [PATCH 3/3] CI: Keep short name --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 722908f8ff..8942ecf288 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: host: needs: ruby-versions - name: build (${{ matrix.ruby }} / ${{ matrix.os }}) + name: ${{ matrix.os }} ${{ matrix.ruby }} runs-on: ${{ matrix.os }} strategy: fail-fast: false