Skip to content

Commit f8d94a3

Browse files
committed
👷 GHA workflow updates
1 parent a437628 commit f8d94a3

10 files changed

Lines changed: 503 additions & 526 deletions

File tree

.github/workflows/ancient.yml

Lines changed: 72 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Ancient Compat (EOL, Ruby 2.5) Matrix
1+
name: MRI 2.4, 2.5 (EOL)
22

33
on:
44
push:
@@ -20,62 +20,112 @@ concurrency:
2020

2121
jobs:
2222
test:
23-
name: Specs - Ruby ${{ matrix.ruby }} ${{ matrix.appraisal }}${{ matrix.name_extra || '' }}
23+
name: Specs ${{ matrix.ruby }} ${{ matrix.appraisal }}${{ matrix.name_extra || '' }}
2424
if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
25+
runs-on: ubuntu-22.04
26+
continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
2527
env: # $BUNDLE_GEMFILE must be set at job level, so it is set for all steps
2628
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}.gemfile
27-
continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
28-
runs-on: ubuntu-22.04
2929
strategy:
3030
fail-fast: false
3131
matrix:
3232
include:
33+
# Ruby 2.4
34+
- ruby: "2.4"
35+
appraisal: "ar-5-1"
36+
exec_cmd: "rake spec:orm:active_record"
37+
gemfile: "Appraisal.root"
38+
rubygems: "3.3.27"
39+
bundler: "2.3.27"
40+
- ruby: "2.4"
41+
appraisal: "ar-5-2"
42+
exec_cmd: "rake spec:orm:active_record"
43+
gemfile: "Appraisal.root"
44+
rubygems: "3.3.27"
45+
bundler: "2.3.27"
46+
- ruby: "2.4"
47+
appraisal: "ar-6-0"
48+
exec_cmd: "rake spec:orm:active_record"
49+
gemfile: "Appraisal.root"
50+
rubygems: "3.3.27"
51+
bundler: "2.3.27"
52+
- ruby: "2.4"
53+
appraisal: "ar-6-1"
54+
exec_cmd: "rake spec:orm:active_record"
55+
gemfile: "Appraisal.root"
56+
rubygems: "3.3.27"
57+
bundler: "2.3.27"
58+
- ruby: "2.4"
59+
appraisal: "couch-1.17"
60+
exec_cmd: "rake spec:orm:couch_potato"
61+
gemfile: "Appraisal.root"
62+
rubygems: "3.3.27"
63+
bundler: "2.3.27"
64+
- ruby: "2.4"
65+
appraisal: "mongoid-7.3"
66+
exec_cmd: "rake spec:orm:mongoid"
67+
gemfile: "Appraisal.root"
68+
rubygems: "3.3.27"
69+
bundler: "2.3.27"
70+
- ruby: "2.4"
71+
appraisal: "mongoid-7.4"
72+
exec_cmd: "rake spec:orm:mongoid"
73+
gemfile: "Appraisal.root"
74+
rubygems: "3.3.27"
75+
bundler: "2.3.27"
76+
- ruby: "2.4"
77+
appraisal: "sequel-5.86"
78+
exec_cmd: "rake spec:orm:sequel"
79+
gemfile: "Appraisal.root"
80+
rubygems: "3.3.27"
81+
bundler: "2.3.27"
82+
3383
# Ruby 2.5
3484
- ruby: "2.5"
3585
appraisal: "ar-5-1"
36-
taskname: "spec:orm:active_record"
86+
exec_cmd: "rake spec:orm:active_record"
3787
gemfile: "Appraisal.root"
3888
rubygems: "3.3.27"
3989
bundler: "2.3.27"
4090
- ruby: "2.5"
4191
appraisal: "ar-5-2"
42-
taskname: "spec:orm:active_record"
92+
exec_cmd: "rake spec:orm:active_record"
4393
gemfile: "Appraisal.root"
4494
rubygems: "3.3.27"
4595
bundler: "2.3.27"
4696
- ruby: "2.5"
4797
appraisal: "ar-6-0"
48-
taskname: "spec:orm:active_record"
98+
exec_cmd: "rake spec:orm:active_record"
4999
gemfile: "Appraisal.root"
50100
rubygems: "3.3.27"
51101
bundler: "2.3.27"
52102
- ruby: "2.5"
53103
appraisal: "ar-6-1"
54-
taskname: "spec:orm:active_record"
104+
exec_cmd: "rake spec:orm:active_record"
55105
gemfile: "Appraisal.root"
56106
rubygems: "3.3.27"
57107
bundler: "2.3.27"
58108
- ruby: "2.5"
59109
appraisal: "couch-1.17"
60-
taskname: "spec:orm:couch_potato"
110+
exec_cmd: "rake spec:orm:couch_potato"
61111
gemfile: "Appraisal.root"
62112
rubygems: "3.3.27"
63113
bundler: "2.3.27"
64114
- ruby: "2.5"
65115
appraisal: "mongoid-7.3"
66-
taskname: "spec:orm:mongoid"
116+
exec_cmd: "rake spec:orm:mongoid"
67117
gemfile: "Appraisal.root"
68118
rubygems: "3.3.27"
69119
bundler: "2.3.27"
70120
- ruby: "2.5"
71121
appraisal: "mongoid-7.4"
72-
taskname: "spec:orm:mongoid"
122+
exec_cmd: "rake spec:orm:mongoid"
73123
gemfile: "Appraisal.root"
74124
rubygems: "3.3.27"
75125
bundler: "2.3.27"
76126
- ruby: "2.5"
77127
appraisal: "sequel-5.86"
78-
taskname: "spec:orm:sequel"
128+
exec_cmd: "rake spec:orm:sequel"
79129
gemfile: "Appraisal.root"
80130
rubygems: "3.3.27"
81131
bundler: "2.3.27"
@@ -84,19 +134,19 @@ jobs:
84134
### COUCHDB
85135
- name: Start CouchDB
86136
uses: iamssen/couchdb-github-action@master
87-
if: "endsWith(matrix.taskname, 'couch_potato')"
137+
if: "endsWith(matrix.exec_cmd, 'couch_potato')"
88138
with:
89139
couchdb-version: "3.4.1"
90140
- name: Smoke CouchDB
91-
if: "endsWith(matrix.taskname, 'couch_potato')"
141+
if: "endsWith(matrix.exec_cmd, 'couch_potato')"
92142
run: |
93143
curl -f http://127.0.0.1:5984/
94144
curl -X POST -H "Content-Type: application/json; charset=utf-8" -d '{"name": "admin", "password": "password"}' http://127.0.0.1:5984/_session
95145
96146
### MONGODB
97147
- name: Start MongoDB
98148
uses: supercharge/mongodb-github-action@1.12.0
99-
if: "endsWith(matrix.taskname, 'mongoid')"
149+
if: "endsWith(matrix.exec_cmd, 'mongoid')"
100150
with:
101151
mongodb-version: "8.0"
102152

@@ -110,12 +160,13 @@ jobs:
110160
rubygems: ${{ matrix.rubygems }}
111161
bundler: ${{ matrix.bundler }}
112162
bundler-cache: false
113-
# This will use the BUNDLE_GEMFILE set to matrix.gemfile (i.e. Appraisal.root)
163+
164+
# Raw `bundle` will use the BUNDLE_GEMFILE set to matrix.gemfile (i.e. Appraisal.root)
114165
# We need to do this first to get appraisal installed.
115-
# NOTE: This does not use the root Gemfile at all.
116-
- name: Bundle for Appraisal ${{ matrix.appraisal }}
166+
# NOTE: This does not use the main Gemfile at all.
167+
- name: Install Root Appraisal
117168
run: bundle
118-
- name: Install Appraisal ${{ matrix.appraisal }} dependencies
169+
- name: Appraisal for ${{ matrix.appraisal }}
119170
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
120-
- name: Run ${{ matrix.appraisal }} tests via ${{ matrix.taskname }}
121-
run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec rake ${{ matrix.taskname }}
171+
- name: Tests for ${{ matrix.ruby }} via ${{ matrix.exec_cmd }}
172+
run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }}

.github/workflows/coverage.yml

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,24 @@ concurrency:
2929
cancel-in-progress: true
3030

3131
jobs:
32-
test:
33-
name: Specs with Coverage - Ruby ${{ matrix.ruby }} ${{ matrix.name_extra || '' }}
32+
coverage:
33+
name: Code Coverage on ${{ matrix.ruby }}@current
3434
if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
35-
env: # $BUNDLE_GEMFILE must be set at job level, so it is set for all steps
36-
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
3735
runs-on: ubuntu-latest
36+
continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
37+
env: # $BUNDLE_GEMFILE must be set at job level, so it is set for all steps
38+
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}.gemfile
3839
strategy:
3940
fail-fast: false
4041
matrix:
41-
experimental: [false]
42-
rubygems:
43-
- latest
44-
bundler:
45-
- latest
46-
gemfile:
47-
- coverage
48-
ruby:
49-
- '3.4'
42+
include:
43+
# Coverage
44+
- ruby: "ruby"
45+
appraisal: "coverage"
46+
exec_cmd: "rake spec:orm:all"
47+
gemfile: "Appraisal.root"
48+
rubygems: latest
49+
bundler: latest
5050

5151
steps:
5252
### COUCHDB
@@ -80,15 +80,22 @@ jobs:
8080
ruby-version: "${{ matrix.ruby }}"
8181
rubygems: "${{ matrix.rubygems }}"
8282
bundler: "${{ matrix.bundler }}"
83-
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
83+
bundler-cache: false
8484

8585
- name: CodeClimate Pre-build Notification
8686
run: cc-test-reporter before-build
8787
if: ${{ github.event_name != 'pull_request' }}
8888
continue-on-error: ${{ matrix.experimental != 'false' }}
8989

90-
- name: Run RSpec tests
91-
run: bundle exec rake spec:orm:all
90+
# Raw `bundle` will use the BUNDLE_GEMFILE set to matrix.gemfile (i.e. Appraisal.root)
91+
# We need to do this first to get appraisal installed.
92+
# NOTE: This does not use the main Gemfile at all.
93+
- name: Install Root Appraisal
94+
run: bundle
95+
- name: Appraisal for ${{ matrix.appraisal }}
96+
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
97+
- name: Tests for ${{ matrix.ruby }}@current via ${{ matrix.exec_cmd }}
98+
run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }}
9299

93100
- name: CodeClimate Post-build Notification
94101
run: cc-test-reporter after-build

.github/workflows/current.yml

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# Targets the evergreen latest release of ruby, truffleruby, and jruby
2+
name: Current
3+
4+
env:
5+
K_SOUP_COV_DO: false
6+
7+
on:
8+
push:
9+
branches:
10+
- 'main'
11+
tags:
12+
- '!*' # Do not execute on tags
13+
pull_request:
14+
branches:
15+
- '*'
16+
# Allow manually triggering the workflow.
17+
workflow_dispatch:
18+
19+
permissions:
20+
contents: read
21+
22+
# Cancels all previous workflow runs for the same branch that have not yet completed.
23+
concurrency:
24+
# The concurrency group contains the workflow name and the branch name.
25+
group: "${{ github.workflow }}-${{ github.ref }}"
26+
cancel-in-progress: true
27+
28+
jobs:
29+
test:
30+
name: Specs ${{ matrix.ruby }}@${{ matrix.appraisal }}
31+
if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
32+
runs-on: ubuntu-latest
33+
continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
34+
env: # $BUNDLE_GEMFILE must be set at job level, so it is set for all steps
35+
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}.gemfile
36+
strategy:
37+
matrix:
38+
include:
39+
# Ruby 3.4
40+
- ruby: "3.4"
41+
appraisal: "ar-7-2"
42+
taskname: "spec:orm:active_record"
43+
gemfile: "Appraisal.root"
44+
rubygems: latest
45+
bundler: latest
46+
- ruby: "3.4"
47+
appraisal: "ar-8-0"
48+
taskname: "spec:orm:active_record"
49+
gemfile: "Appraisal.root"
50+
rubygems: latest
51+
bundler: latest
52+
- ruby: "3.4"
53+
appraisal: "couch-1.17"
54+
taskname: "spec:orm:couch_potato"
55+
gemfile: "Appraisal.root"
56+
rubygems: latest
57+
bundler: latest
58+
- ruby: "3.4"
59+
appraisal: "mongoid-8.1"
60+
taskname: "spec:orm:mongoid"
61+
gemfile: "Appraisal.root"
62+
rubygems: latest
63+
bundler: latest
64+
- ruby: "3.4"
65+
appraisal: "mongoid-9.0"
66+
taskname: "spec:orm:mongoid"
67+
gemfile: "Appraisal.root"
68+
rubygems: latest
69+
bundler: latest
70+
- ruby: "3.4"
71+
appraisal: "sequel-5.86"
72+
taskname: "spec:orm:sequel"
73+
gemfile: "Appraisal.root"
74+
rubygems: latest
75+
bundler: latest
76+
77+
# truffleruby-24.1
78+
# (according to documentation: targets Ruby 3.3 compatibility)
79+
# (according to runtime: targets Ruby 3.2 compatibility)
80+
- ruby: "truffleruby"
81+
appraisal: "ar-8-0"
82+
taskname: "spec:orm:active_record"
83+
gemfile: "Appraisal.root"
84+
rubygems: latest
85+
bundler: latest
86+
87+
# jruby-9.4 (targets Ruby 3.1 compatibility)
88+
- ruby: "jruby"
89+
appraisal: "current"
90+
exec_cmd: "rake spec"
91+
gemfile: "Appraisal.root"
92+
rubygems: default
93+
bundler: default
94+
95+
steps:
96+
- name: Checkout
97+
uses: actions/checkout@v4
98+
99+
- name: Setup Ruby & RubyGems
100+
uses: ruby/setup-ruby@v1
101+
with:
102+
ruby-version: ${{ matrix.ruby }}
103+
rubygems: ${{ matrix.rubygems }}
104+
bundler: ${{ matrix.bundler }}
105+
bundler-cache: false
106+
107+
# Raw `bundle` will use the BUNDLE_GEMFILE set to matrix.gemfile (i.e. Appraisal.root)
108+
# We need to do this first to get appraisal installed.
109+
# NOTE: This does not use the main Gemfile at all.
110+
- name: Install Root Appraisal
111+
run: bundle
112+
- name: Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal }}
113+
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
114+
- name: Tests for ${{ matrix.ruby }}@${{ matrix.appraisal }} via ${{ matrix.exec_cmd }}
115+
run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }}

0 commit comments

Comments
 (0)