6
6
branches :
7
7
- main
8
8
9
- env :
10
- RAILS_VERSIONS : ' ["5.2.8.1", "6.1.7.6", "7.1.3.2"]'
11
-
12
9
jobs :
13
10
set-matrix :
14
11
runs-on : ubuntu-latest
15
12
name : Set Rails versions
16
13
outputs :
17
- RAILS_VERSIONS : ${{ env .RAILS_VERSIONS }}
14
+ RAILS_VERSIONS : ${{ steps.compute-outputs.outputs .RAILS_VERSIONS }}
18
15
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
20
19
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
22
22
build-rails :
23
23
strategy :
24
24
fail-fast : false
25
25
matrix :
26
+ # Build containers with the latest 5.x.x, 6.x.x and 7.x.x Rails versions
26
27
rails : ${{ fromJSON(needs.set-matrix.outputs.RAILS_VERSIONS) }}
27
28
runs-on : ubuntu-latest
28
29
name : Build and cache Docker containers
53
54
mailer-previews :
54
55
strategy :
55
56
fail-fast : false
57
+ # Run against the latest 5.x.x, 6.x.x and 7.x.x Rails versions
56
58
matrix :
57
59
rails : ${{ fromJSON(needs.set-matrix.outputs.RAILS_VERSIONS) }}
58
60
runs-on : ubuntu-latest
76
78
sending :
77
79
strategy :
78
80
fail-fast : false
81
+ # Run against the latest 5.x.x, 6.x.x and 7.x.x Rails versions
79
82
matrix :
80
83
rails : ${{ fromJSON(needs.set-matrix.outputs.RAILS_VERSIONS) }}
81
84
runs-on : ubuntu-latest
96
99
run : |
97
100
docker run --rm -e "NOTIFY_API_KEY=$NOTIFY_API_KEY" \
98
101
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
+ }}
0 commit comments