Skip to content

Commit 27d23f4

Browse files
authored
Bump the minimum version in the test matrix (primer#3738)
1 parent d209289 commit 27d23f4

2 files changed

Lines changed: 27 additions & 49 deletions

File tree

.github/workflows/test.yml

Lines changed: 21 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ jobs:
3030
- uses: actions/checkout@v5
3131
- uses: ruby/setup-ruby@v1
3232
with:
33-
ruby-version: '3.4'
33+
ruby-version: "3.4"
3434
bundler-cache: true
3535
- uses: actions/setup-node@v5
3636
with:
3737
node-version: 20
38-
cache: 'npm'
38+
cache: "npm"
3939
cache-dependency-path: |
4040
package-lock.json
4141
demo/package-lock.json
@@ -46,20 +46,12 @@ jobs:
4646
- name: Test
4747
run: bundle exec rake test:accessibility
4848
components:
49-
name: Components
49+
name: Components (${{ matrix.label }})
5050
runs-on: ubuntu-latest
5151
strategy:
5252
fail-fast: false
5353
matrix:
54-
include:
55-
- rails_version: '7.2.2.1'
56-
ruby_version: '3.2'
57-
- rails_version: '7.2.2.1'
58-
ruby_version: '3.3'
59-
- rails_version: 'main'
60-
ruby_version: '3.3'
61-
- rails_version: 'main'
62-
ruby_version: '3.4'
54+
include: ${{ fromJson(vars.TEST_MATRIX) }}
6355
steps:
6456
- uses: actions/checkout@v5
6557
- uses: ruby/setup-ruby@v1
@@ -70,7 +62,7 @@ jobs:
7062
- uses: actions/setup-node@v5
7163
with:
7264
node-version: 20
73-
cache: 'npm'
65+
cache: "npm"
7466
- name: Build
7567
run: |
7668
npm ci
@@ -88,20 +80,12 @@ jobs:
8880
RUBY_VERSION: ${{ matrix.ruby_version }}
8981
RAILS_VERSION: ${{ matrix.rails_version }}
9082
lib:
91-
name: Lib
83+
name: Lib (${{ matrix.label }})
9284
runs-on: ubuntu-latest
9385
strategy:
9486
fail-fast: false
9587
matrix:
96-
include:
97-
- rails_version: '7.2.2.1'
98-
ruby_version: '3.2'
99-
- rails_version: '7.2.2.1'
100-
ruby_version: '3.3'
101-
- rails_version: 'main'
102-
ruby_version: '3.3'
103-
- rails_version: 'main'
104-
ruby_version: '3.4'
88+
include: ${{ fromJson(vars.TEST_MATRIX) }}
10589
steps:
10690
- uses: actions/checkout@v5
10791
- uses: ruby/setup-ruby@v1
@@ -112,7 +96,7 @@ jobs:
11296
- uses: actions/setup-node@v5
11397
with:
11498
node-version: 20
115-
cache: 'npm'
99+
cache: "npm"
116100
- name: Build
117101
run: |
118102
npm ci
@@ -130,20 +114,12 @@ jobs:
130114
RUBY_VERSION: ${{ matrix.ruby_version }}
131115
RAILS_VERSION: ${{ matrix.rails_version }}
132116
performance:
133-
name: Performance
117+
name: Performance (${{ matrix.label }})
134118
runs-on: ubuntu-latest
135119
strategy:
136120
fail-fast: false
137121
matrix:
138-
include:
139-
- rails_version: '7.2.2.1'
140-
ruby_version: '3.2'
141-
- rails_version: '7.2.2.1'
142-
ruby_version: '3.3'
143-
- rails_version: 'main'
144-
ruby_version: '3.3'
145-
- rails_version: 'main'
146-
ruby_version: '3.4'
122+
include: ${{ fromJson(vars.TEST_MATRIX) }}
147123
steps:
148124
- uses: actions/checkout@v5
149125
- uses: ruby/setup-ruby@v1
@@ -171,12 +147,12 @@ jobs:
171147
- uses: actions/checkout@v5
172148
- uses: ruby/setup-ruby@v1
173149
with:
174-
ruby-version: '3.2'
150+
ruby-version: "3.2"
175151
bundler-cache: true
176152
- uses: actions/setup-node@v5
177153
with:
178154
node-version: 20
179-
cache: 'npm'
155+
cache: "npm"
180156
cache-dependency-path: |
181157
package-lock.json
182158
demo/package-lock.json
@@ -194,12 +170,12 @@ jobs:
194170
- uses: actions/checkout@v5
195171
- uses: ruby/setup-ruby@v1
196172
with:
197-
ruby-version: '3.2'
173+
ruby-version: "3.2"
198174
bundler-cache: true
199175
- uses: actions/setup-node@v5
200176
with:
201177
node-version: 20
202-
cache: 'npm'
178+
cache: "npm"
203179
cache-dependency-path: |
204180
package-lock.json
205181
demo/package-lock.json
@@ -223,12 +199,12 @@ jobs:
223199
fetch-depth: 0
224200
- uses: ruby/setup-ruby@v1
225201
with:
226-
ruby-version: '3.2'
202+
ruby-version: "3.2"
227203
bundler-cache: true
228204
- uses: actions/setup-node@v5
229205
with:
230206
node-version: 20
231-
cache: 'npm'
207+
cache: "npm"
232208
cache-dependency-path: |
233209
package-lock.json
234210
demo/package-lock.json
@@ -269,7 +245,7 @@ jobs:
269245
commit_message: Generating component snapshots
270246
file_pattern: .playwright/screenshots/**/*.png .playwright/screenshots/**/*.yml
271247
push_options: --force-with-lease
272-
- name: 'Changes detected'
248+
- name: "Changes detected"
273249
if: steps.auto-commit.outputs.changes_detected == 'true'
274250
uses: phulsechinmay/rewritable-pr-comment@v0.3.0
275251
with:
@@ -280,7 +256,7 @@ jobs:
280256
281257
[Review differences](https://github.com/primer/view_components/pull/${{ github.event.number }}/files?file-filters%5B%5D=.png&file-filters%5B%5D=.yml&show-viewed-files=false)
282258
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
283-
COMMENT_IDENTIFIER: 'visual-comparison-diff'
259+
COMMENT_IDENTIFIER: "visual-comparison-diff"
284260
- uses: actions/upload-artifact@v4
285261
with:
286262
name: playwright-report
@@ -298,17 +274,17 @@ jobs:
298274
- name: Setup Ruby
299275
uses: ruby/setup-ruby@v1
300276
with:
301-
ruby-version: '3.2'
277+
ruby-version: "3.2"
302278
bundler-cache: true
303279
- name: Setup Node
304280
uses: actions/setup-node@v5
305281
with:
306282
node-version: 20
307-
cache: 'npm'
283+
cache: "npm"
308284
- name: NPM Build
309285
run: npm ci
310286
env:
311287
# Disable CSS minification for tests
312-
CI: 'false'
288+
CI: "false"
313289
- name: Test CSS
314290
run: bundle exec rake test:component_css

Gemfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@ gem "rack-cors"
99
gem "rake", "~> 13.3"
1010

1111
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
12-
13-
# rubocop:disable Bundler/DuplicatedGem
14-
if rails_version == "main"
12+
if rails_version == "latest"
13+
gem "actionview"
14+
gem "activemodel"
15+
gem "activesupport"
16+
gem "railties"
17+
elsif rails_version == "main"
1518
git "https://github.com/rails/rails", ref: "main" do
1619
gem "actionview"
1720
gem "activemodel"
@@ -25,7 +28,6 @@ else
2528
gem "activesupport", rails_version
2629
gem "railties", rails_version
2730
end
28-
# rubocop:enable Bundler/DuplicatedGem
2931

3032
# Use Puma as the app server
3133
gem "puma", "~> 7.0.4"

0 commit comments

Comments
 (0)