Skip to content

Commit 8524dcf

Browse files
authored
Merge pull request #154 from dxw/chore/get-latest-rails-versions
(Chore) Get latest Rails versions
2 parents f6fd42a + 8b08e8f commit 8524dcf

File tree

3 files changed

+40
-7
lines changed

3 files changed

+40
-7
lines changed

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

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,24 @@ on:
66
branches:
77
- main
88

9-
env:
10-
RAILS_VERSIONS: '["5.2.8.1", "6.1.7.6", "7.1.3.2"]'
11-
129
jobs:
1310
set-matrix:
1411
runs-on: ubuntu-latest
1512
name: Set Rails versions
1613
outputs:
17-
RAILS_VERSIONS: ${{ env.RAILS_VERSIONS }}
14+
RAILS_VERSIONS: ${{ steps.compute-outputs.outputs.RAILS_VERSIONS }}
1815
steps:
19-
- name: Compute outputs
16+
# Get latest Rails versions for 5.x.x, 6.x.x and 7.x.x
17+
- id: compute-outputs
18+
name: Compute outputs
2019
run: |
21-
echo "RAILS_VERSIONS=${{ env.RAILS_VERSIONS }}" >> $GITHUB_OUTPUT
20+
rails_versions=$(curl https://rubygems.org/api/v1/versions/rails.json | jq 'group_by(.number[:1])[] | (.[0].number) | select(.[:1]|tonumber > 4)' | jq -s -c)
21+
echo "RAILS_VERSIONS=$rails_versions" >> $GITHUB_OUTPUT
2222
build-rails:
2323
strategy:
2424
fail-fast: false
2525
matrix:
26+
# Build containers with the latest 5.x.x, 6.x.x and 7.x.x Rails versions
2627
rails: ${{ fromJSON(needs.set-matrix.outputs.RAILS_VERSIONS) }}
2728
runs-on: ubuntu-latest
2829
name: Build and cache Docker containers
@@ -53,6 +54,7 @@ jobs:
5354
mailer-previews:
5455
strategy:
5556
fail-fast: false
57+
# Run against the latest 5.x.x, 6.x.x and 7.x.x Rails versions
5658
matrix:
5759
rails: ${{ fromJSON(needs.set-matrix.outputs.RAILS_VERSIONS) }}
5860
runs-on: ubuntu-latest
@@ -76,6 +78,7 @@ jobs:
7678
sending:
7779
strategy:
7880
fail-fast: false
81+
# Run against the latest 5.x.x, 6.x.x and 7.x.x Rails versions
7982
matrix:
8083
rails: ${{ fromJSON(needs.set-matrix.outputs.RAILS_VERSIONS) }}
8184
runs-on: ubuntu-latest
@@ -96,3 +99,19 @@ jobs:
9699
run: |
97100
docker run --rm -e "NOTIFY_API_KEY=$NOTIFY_API_KEY" \
98101
mail-notify-integration-rails-${{ matrix.rails }}:latest bin/rails test
102+
results:
103+
if: ${{ always() }}
104+
runs-on: ubuntu-latest
105+
name: All integration tests
106+
needs:
107+
- mailer-previews
108+
- sending
109+
steps:
110+
# If any of the previous actions failed, we return a non-zero exit code
111+
- run: exit 1
112+
if: >-
113+
${{
114+
contains(needs.*.result, 'failure')
115+
|| contains(needs.*.result, 'cancelled')
116+
|| contains(needs.*.result, 'skipped')
117+
}}

.github/workflows/unit-tests.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,17 @@ jobs:
2424
uses: coverallsapp/github-action@v2
2525
with:
2626
fail-on-error: false
27+
results:
28+
if: ${{ always() }}
29+
runs-on: ubuntu-latest
30+
name: All unit tests
31+
needs: [ unit-tests ]
32+
steps:
33+
# If any of the previous actions failed, we return a non-zero exit code
34+
- run: exit 1
35+
if: >-
36+
${{
37+
contains(needs.*.result, 'failure')
38+
|| contains(needs.*.result, 'cancelled')
39+
|| contains(needs.*.result, 'skipped')
40+
}}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Build status](https://github.com/dxw/mail-notify/actions/workflows/ci.yml/badge.svg)](https://github.com/dxw/mail-notify/actions/workflows/ci.yml)
1+
[![Build status](https://github.com/dxw/mail-notify/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/dxw/mail-notify/actions/workflows/unit-tests.yml)
22
[![Coverage status](https://coveralls.io/repos/github/dxw/mail-notify/badge.svg?branch=fix-coveralls)](https://coveralls.io/github/dxw/mail-notify?branch=fix-coveralls)
33
[![Gem Version](http://img.shields.io/gem/v/mail-notify.svg?style=flat-square)](https://rubygems.org/gems/mail-notify)
44
[![Rails integration tests](https://github.com/dxw/mail-notify/actions/workflows/rails-integration-tests.yml/badge.svg)](https://github.com/dxw/mail-notify/actions/workflows/rails-integration-tests.yml)

0 commit comments

Comments
 (0)