-
Notifications
You must be signed in to change notification settings - Fork 41
190 lines (159 loc) · 7.46 KB
/
ruby.yml
File metadata and controls
190 lines (159 loc) · 7.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
name: CI
on:
push:
branches: [main]
pull_request:
branches: ['**']
schedule:
- cron: "0 2 * * TUE"
jobs:
test:
runs-on: ubuntu-latest
name: test (${{ matrix.blacklight_version && format('bl {0} / ', matrix.blacklight_version) }}rails ${{ matrix.rails_version }} / rb ${{ matrix.ruby }} ${{ matrix.additional_name }})
strategy:
fail-fast: false
matrix:
# We have SEVERAL axes of difference we support.
#
# * Blacklight: 7, 8, or 9
# * Rails: 7 or 8
# * sprockets or propshaft (with cssbundling-rails sass)
# * importmap-rails or esbuild (each with sprockets or importmaps)
#
# We should work with almost every combo of these (even though BL itself
# doesn't officially support every one), but we don't test with every one,
# that'd be too much. Plus BL can't *generate* every one even though it
# can be made to work with every one. We test with some good significant
# representative samples.
#
# If 'blacklight_version' includes `://`, will be understood as github url,
# used for testing off blacklight main.
include:
# BLACKLIGHT EDGE, can test with latest rails, importmap and esbuild
#
- rails_version: "~> 8.1.0"
blacklight_version: 'https://github.com/projectblacklight/blacklight.git'
ruby: "3.3"
additional_name: "/ importmap-rails"
additional_engine_cart_rails_options: "--css=bootstrap"
- rails_version: "~> 8.1.0"
blacklight_version: 'https://github.com/projectblacklight/blacklight.git'
ruby: "3.3"
additional_name: "/ esbuild"
additional_engine_cart_rails_options: "--css=bootstrap --javascript=esbuild"
# BLACKLIGHT 9 and with Rails 8 and 8.1
#
- rails_version: "~> 8.1.0"
blacklight_version: '~> 9.0'
ruby: "3.4"
additional_name: "/ importmap-rails"
additional_engine_cart_rails_options: "--css=bootstrap"
- rails_version: "~> 8.1.0"
blacklight_version: '~> 9.0'
ruby: "3.4"
additional_name: "/ esbuild"
additional_engine_cart_rails_options: "--css=bootstrap --javascript=esbuild"
- rails_version: "~> 8.0.0"
blacklight_version: '~> 9.0'
ruby: "3.4"
additional_name: "/ importmap-rails"
additional_engine_cart_rails_options: "--css=bootstrap"
- rails_version: "~> 8.0.0"
blacklight_version: '~> 9.0'
ruby: "3.4"
additional_name: "/ esbuild"
additional_engine_cart_rails_options: "--css=bootstrap --javascript=esbuild"
# BLACKLIGHT 8, can test with use importmaps and esbuild, also rails 8 and 8.1
# and a bit of 7.2
- rails_version: "~> 8.1.0"
blacklight_version: "~> 8.0"
ruby: "3.3"
additional_name: "/ importmap-rails, propshaft"
additional_engine_cart_rails_options: "-a propshaft --css=bootstrap"
- rails_version: "~> 8.1.0"
blacklight_version: "~> 8.0"
ruby: "3.3"
additional_engine_cart_rails_options: "-a propshaft --javascript=esbuild --css=bootstrap"
additional_name: "/ esbuild, propshaft"
- rails_version: "~> 8.0.0"
blacklight_version: "~> 8.0"
ruby: "3.3"
additional_name: "/ importmap-rails, propshaft"
additional_engine_cart_rails_options: "-a propshaft --css=bootstrap"
- rails_version: "7.2.1"
blacklight_version: "~> 8.0"
ruby: "3.3"
additional_name: "/ importmap-rails, sprockets"
- rails_version: "7.2.1"
blacklight_version: "~> 8.0"
ruby: "3.3"
additional_name: "/ importmap-rails, propshaft"
additional_engine_cart_rails_options: "-a propshaft --css=bootstrap"
- rails_version: "7.2.1"
blacklight_version: "~> 8.0"
ruby: "3.3"
additional_engine_cart_rails_options: "-a propshaft --javascript=esbuild --css=bootstrap"
additional_name: "/ esbuild, propshaft"
# We can't currently test Blacklight 8 in a few situations we'd like to.
#
# * Blacklight 8 can't easily generate an app with Rails 7 and sprockets and esbuild
# (the default layout won't be right), although I think it should work fine.
#
# * Can't test with unreleased Blacklight main and esbuild because the blacklight-frontend
# npm package doesn't work from git checkout. So currently can't test with Rails 8
# and esbuild.
# BLACKLIGHT 7, only test with esbuild, not sure if it supports importmaps, it won't generate it
# Blacklight 7 generator uses old `Bundler.with_clean_env`, so needs a bundler < 4. (there is no
# bundler 3!)
- rails_version: "7.2.1"
blacklight_version: "~> 7.0"
ruby: "3.3"
additional_engine_cart_rails_options: "--javascript=esbuild"
additional_name: "/ esbuild, sprockets"
bundler: "2.7.2"
- rails_version: "7.2.1"
blacklight_version: "~> 7.0"
ruby: "3.3"
additional_engine_cart_rails_options: "--javascript=esbuild --css=bootstrap -a propshaft"
additional_name: "/ esbuild, propshaft"
bundler: "2.7.2"
- rails_version: "7.1.4"
blacklight_version: "~> 7.0"
ruby: "3.2"
additional_engine_cart_rails_options: "--javascript=esbuild"
additional_name: "/ esbuild, sprockets"
bundler: "2.7.2"
env:
BLACKLIGHT_VERSION: ${{ matrix.blacklight_version || '~> 8.0' }}
RAILS_VERSION: ${{ matrix.rails_version }}
ENGINE_CART_RAILS_OPTIONS: "--skip-git --skip-listen --skip-spring --skip-keeps --skip-coffee --skip-test ${{ matrix.additional_engine_cart_rails_options }}"
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
#bundler: ${{ matrix.bundler != '' && matrix.bundler || 'latest' }}
# Bundler locked to <4, see https://github.com/projectblacklight/blacklight_range_limit/pull/328
bundler: ${{ matrix.bundler != '' && matrix.bundler || '2.7.2' }}
- name: Install dependencies
run: bundle install
# Try to cache solr dist download, which may not save us much time,
# but hopes to save us from being throttled/blocked on some runs by
# apache foundation servers unhappy that we're downloading the dist zip
# so much.
- name: Cache solr install
uses: actions/cache@v3
with:
# these paths specified in .solr_wrapper.yml:
path: |
ci_dl_solr_dist
key: ${{ runner.os }}-solr-${{ hashFiles('.solr_wrapper.yml') }}
- name: Run tests
run: bundle exec rake ci