Skip to content

Commit 21c9262

Browse files
authored
feat: use macos-(latest|13) based on node version (#440)
1 parent 732dddc commit 21c9262

File tree

7 files changed

+110
-1
lines changed

7 files changed

+110
-1
lines changed

.github/workflows/ci-release.yml

+14
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ jobs:
8080
- name: macOS
8181
os: macos-latest
8282
shell: bash
83+
- name: macOS
84+
os: macos-13
85+
shell: bash
8386
- name: Windows
8487
os: windows-latest
8588
shell: cmd
@@ -89,6 +92,17 @@ jobs:
8992
- 20.5.0
9093
- 20.x
9194
- 22.x
95+
exclude:
96+
- platform: { name: macOS, os: macos-13, shell: bash }
97+
node-version: 18.17.0
98+
- platform: { name: macOS, os: macos-13, shell: bash }
99+
node-version: 18.x
100+
- platform: { name: macOS, os: macos-13, shell: bash }
101+
node-version: 20.5.0
102+
- platform: { name: macOS, os: macos-13, shell: bash }
103+
node-version: 20.x
104+
- platform: { name: macOS, os: macos-13, shell: bash }
105+
node-version: 22.x
92106
runs-on: ${{ matrix.platform.os }}
93107
defaults:
94108
run:

.github/workflows/ci-test-workspace.yml

+14
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ jobs:
6161
- name: macOS
6262
os: macos-latest
6363
shell: bash
64+
- name: macOS
65+
os: macos-13
66+
shell: bash
6467
- name: Windows
6568
os: windows-latest
6669
shell: cmd
@@ -70,6 +73,17 @@ jobs:
7073
- 20.5.0
7174
- 20.x
7275
- 22.x
76+
exclude:
77+
- platform: { name: macOS, os: macos-13, shell: bash }
78+
node-version: 18.17.0
79+
- platform: { name: macOS, os: macos-13, shell: bash }
80+
node-version: 18.x
81+
- platform: { name: macOS, os: macos-13, shell: bash }
82+
node-version: 20.5.0
83+
- platform: { name: macOS, os: macos-13, shell: bash }
84+
node-version: 20.x
85+
- platform: { name: macOS, os: macos-13, shell: bash }
86+
node-version: 22.x
7387
runs-on: ${{ matrix.platform.os }}
7488
defaults:
7589
run:

.github/workflows/ci.yml

+14
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ jobs:
6161
- name: macOS
6262
os: macos-latest
6363
shell: bash
64+
- name: macOS
65+
os: macos-13
66+
shell: bash
6467
- name: Windows
6568
os: windows-latest
6669
shell: cmd
@@ -70,6 +73,17 @@ jobs:
7073
- 20.5.0
7174
- 20.x
7275
- 22.x
76+
exclude:
77+
- platform: { name: macOS, os: macos-13, shell: bash }
78+
node-version: 18.17.0
79+
- platform: { name: macOS, os: macos-13, shell: bash }
80+
node-version: 18.x
81+
- platform: { name: macOS, os: macos-13, shell: bash }
82+
node-version: 20.5.0
83+
- platform: { name: macOS, os: macos-13, shell: bash }
84+
node-version: 20.x
85+
- platform: { name: macOS, os: macos-13, shell: bash }
86+
node-version: 22.x
7387
runs-on: ${{ matrix.platform.os }}
7488
defaults:
7589
run:

lib/content/_job-matrix-yml.hbs

+10
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ strategy:
1111
- name: macOS
1212
os: macos-latest
1313
shell: bash
14+
- name: macOS
15+
os: macos-13
16+
shell: bash
1417
{{/if}}
1518
{{#if windowsCI}}
1619
- name: Windows
@@ -21,6 +24,13 @@ strategy:
2124
{{#each ciVersions}}
2225
- {{ . }}
2326
{{/each}}
27+
{{#if macCI}}
28+
exclude:
29+
{{#each ciVersions}}
30+
- platform: {name: macOS, os: macos-{{#if (lte (semverRangeMajor .) 14)}}latest{{else}}13{{/if}}, shell: bash}
31+
node-version: {{ . }}
32+
{{/each}}
33+
{{/if}}
2434
runs-on: $\{{ matrix.platform.os }}
2535
defaults:
2636
run:

lib/util/template.js

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const Handlebars = require('handlebars')
22
const { basename, extname, join } = require('path')
3+
const { Range } = require('semver')
34
const fs = require('fs')
45
const DELETE = '__DELETE__'
56

@@ -39,6 +40,8 @@ const setupHandlebars = (dirs) => {
3940
Handlebars.registerHelper('last', (arr) => arr[arr.length - 1])
4041
Handlebars.registerHelper('json', (c) => JSON.stringify(c))
4142
Handlebars.registerHelper('del', () => JSON.stringify(DELETE))
43+
Handlebars.registerHelper('semverRangeMajor', (v) => new Range(v).set[0][0].semver.major)
44+
Handlebars.registerHelper('lte', (a, b) => a <= b)
4245

4346
if (Array.isArray(dirs)) {
4447
const [baseDir, ...otherDirs] = dirs

tap-snapshots/test/apply/source-snapshots.js.test.cjs

+54
Original file line numberDiff line numberDiff line change
@@ -471,11 +471,17 @@ jobs:
471471
- name: macOS
472472
os: macos-latest
473473
shell: bash
474+
- name: macOS
475+
os: macos-13
476+
shell: bash
474477
- name: Windows
475478
os: windows-latest
476479
shell: cmd
477480
node-version:
478481
- 22.x
482+
exclude:
483+
- platform: { name: macOS, os: macos-13, shell: bash }
484+
node-version: 22.x
479485
runs-on: \${{ matrix.platform.os }}
480486
defaults:
481487
run:
@@ -584,11 +590,17 @@ jobs:
584590
- name: macOS
585591
os: macos-latest
586592
shell: bash
593+
- name: macOS
594+
os: macos-13
595+
shell: bash
587596
- name: Windows
588597
os: windows-latest
589598
shell: cmd
590599
node-version:
591600
- 22.x
601+
exclude:
602+
- platform: { name: macOS, os: macos-13, shell: bash }
603+
node-version: 22.x
592604
runs-on: \${{ matrix.platform.os }}
593605
defaults:
594606
run:
@@ -1878,11 +1890,17 @@ jobs:
18781890
- name: macOS
18791891
os: macos-latest
18801892
shell: bash
1893+
- name: macOS
1894+
os: macos-13
1895+
shell: bash
18811896
- name: Windows
18821897
os: windows-latest
18831898
shell: cmd
18841899
node-version:
18851900
- 22.x
1901+
exclude:
1902+
- platform: { name: macOS, os: macos-13, shell: bash }
1903+
node-version: 22.x
18861904
runs-on: \${{ matrix.platform.os }}
18871905
defaults:
18881906
run:
@@ -1978,11 +1996,17 @@ jobs:
19781996
- name: macOS
19791997
os: macos-latest
19801998
shell: bash
1999+
- name: macOS
2000+
os: macos-13
2001+
shell: bash
19812002
- name: Windows
19822003
os: windows-latest
19832004
shell: cmd
19842005
node-version:
19852006
- 22.x
2007+
exclude:
2008+
- platform: { name: macOS, os: macos-13, shell: bash }
2009+
node-version: 22.x
19862010
runs-on: \${{ matrix.platform.os }}
19872011
defaults:
19882012
run:
@@ -2095,11 +2119,17 @@ jobs:
20952119
- name: macOS
20962120
os: macos-latest
20972121
shell: bash
2122+
- name: macOS
2123+
os: macos-13
2124+
shell: bash
20982125
- name: Windows
20992126
os: windows-latest
21002127
shell: cmd
21012128
node-version:
21022129
- 22.x
2130+
exclude:
2131+
- platform: { name: macOS, os: macos-13, shell: bash }
2132+
node-version: 22.x
21032133
runs-on: \${{ matrix.platform.os }}
21042134
defaults:
21052135
run:
@@ -2214,11 +2244,17 @@ jobs:
22142244
- name: macOS
22152245
os: macos-latest
22162246
shell: bash
2247+
- name: macOS
2248+
os: macos-13
2249+
shell: bash
22172250
- name: Windows
22182251
os: windows-latest
22192252
shell: cmd
22202253
node-version:
22212254
- 22.x
2255+
exclude:
2256+
- platform: { name: macOS, os: macos-13, shell: bash }
2257+
node-version: 22.x
22222258
runs-on: \${{ matrix.platform.os }}
22232259
defaults:
22242260
run:
@@ -3525,11 +3561,17 @@ jobs:
35253561
- name: macOS
35263562
os: macos-latest
35273563
shell: bash
3564+
- name: macOS
3565+
os: macos-13
3566+
shell: bash
35283567
- name: Windows
35293568
os: windows-latest
35303569
shell: cmd
35313570
node-version:
35323571
- 22.x
3572+
exclude:
3573+
- platform: { name: macOS, os: macos-13, shell: bash }
3574+
node-version: 22.x
35333575
runs-on: \${{ matrix.platform.os }}
35343576
defaults:
35353577
run:
@@ -3625,11 +3667,17 @@ jobs:
36253667
- name: macOS
36263668
os: macos-latest
36273669
shell: bash
3670+
- name: macOS
3671+
os: macos-13
3672+
shell: bash
36283673
- name: Windows
36293674
os: windows-latest
36303675
shell: cmd
36313676
node-version:
36323677
- 22.x
3678+
exclude:
3679+
- platform: { name: macOS, os: macos-13, shell: bash }
3680+
node-version: 22.x
36333681
runs-on: \${{ matrix.platform.os }}
36343682
defaults:
36353683
run:
@@ -3742,11 +3790,17 @@ jobs:
37423790
- name: macOS
37433791
os: macos-latest
37443792
shell: bash
3793+
- name: macOS
3794+
os: macos-13
3795+
shell: bash
37453796
- name: Windows
37463797
os: windows-latest
37473798
shell: cmd
37483799
node-version:
37493800
- 22.x
3801+
exclude:
3802+
- platform: { name: macOS, os: macos-13, shell: bash }
3803+
node-version: 22.x
37503804
runs-on: \${{ matrix.platform.os }}
37513805
defaults:
37523806
run:

tap-snapshots/test/check/diff-snapshots.js.test.cjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ The repo file ci.yml needs to be updated:
175175
176176
.github/workflows/ci.yml
177177
========================================
178-
@@ -77,4 +77,24 @@
178+
@@ -97,4 +97,24 @@
179179
shell: \${{ matrix.platform.shell }}
180180
steps:
181181
- name: Checkout

0 commit comments

Comments
 (0)