Skip to content

Commit 07b0d67

Browse files
committed
Set Ruby version for Dockerfile from .ruby-version
1 parent 332a0c5 commit 07b0d67

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

.github/workflows/rails-integration-tests.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ jobs:
2020
run: |
2121
rails_versions=$(curl https://rubygems.org/api/v1/versions/rails.json | jq '[.[] | select(.number | test("beta") | not)] | group_by(.number[:1])[] | (.[0].number) | select(.[:1]|tonumber > 5)' | jq -s -c)
2222
echo "RAILS_VERSIONS=$rails_versions" >> $GITHUB_OUTPUT
23+
set-ruby-version:
24+
runs-on: ubuntu-latest
25+
name: Set Rails versions
26+
outputs:
27+
RAILS_VERSIONS: ${{ steps.set-ruby-version.outputs.RUBY_VERSION }}
28+
steps:
29+
- id: set-ruby-version
30+
name: Set Ruby version
31+
run: |
32+
echo "RUBY_VERSION=$(cat .ruby-version)" >> $GITHUB_OUTPUT
2333
build-rails:
2434
strategy:
2535
fail-fast: false
@@ -28,7 +38,9 @@ jobs:
2838
rails: ${{ fromJSON(needs.set-matrix.outputs.RAILS_VERSIONS) }}
2939
runs-on: ubuntu-latest
3040
name: Build and cache Docker containers
31-
needs: set-matrix
41+
needs:
42+
- set-matrix
43+
- set-ruby-version
3244
steps:
3345
- name: Checkout
3446
uses: actions/checkout@v4
@@ -42,6 +54,7 @@ jobs:
4254
build-args: |
4355
RAILS_VERSION=${{ matrix.rails }}
4456
MAIL_NOTIFY_BRANCH=${{ github.ref }}
57+
RUBY_VERSION=${{ needs.set-ruby-version.outputs.RUBY_VERSION }}
4558
push: false
4659
tags: mail-notify-integration-rails-${{ matrix.rails }}:latest
4760
outputs: type=docker, dest=/tmp/rails-${{ matrix.rails }}-image.tar
@@ -61,6 +74,7 @@ jobs:
6174
runs-on: ubuntu-latest
6275
needs:
6376
- set-matrix
77+
- set-ruby-version
6478
- build-rails
6579
steps:
6680
- name: Download image
@@ -85,6 +99,7 @@ jobs:
8599
runs-on: ubuntu-latest
86100
needs:
87101
- set-matrix
102+
- set-ruby-version
88103
- build-rails
89104
steps:
90105
- name: Download image

0 commit comments

Comments
 (0)