Skip to content

Commit 05d3c0b

Browse files
authored
Make node versions dynamic (#124)
* use default node versions * add to other workflows * spacing * remove os matrix when it's not used * spacing * only test package managers on ubuntu, as is the case with fastify/fastify * update readme * update desc * remove stringified * don't add matrix is to benchmark
1 parent 821ceac commit 05d3c0b

File tree

9 files changed

+62
-26
lines changed

9 files changed

+62
-26
lines changed

.github/workflows/plugins-benchmark-pr.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ on:
3131
type: string
3232
default: ${{ github.event.pull_request.base.ref }}
3333
required: false
34+
node-versions:
35+
description: 'A JSON array that specifies the Node.js versions on which the job should run.'
36+
required: false
37+
default: '["18", "20", "21"]'
38+
type: string
39+
3440
jobs:
3541
benchmark:
3642
if: ${{ github.event.label.name == 'benchmark' }}
@@ -47,7 +53,7 @@ jobs:
4753

4854
strategy:
4955
matrix:
50-
node-version: [18, 20, 21]
56+
node-version: ${{ fromJson(inputs.node-versions) }}
5157
steps:
5258
- name: Checkout ${{ inputs.pr-repo }}@${{ inputs.pr-ref }}
5359
uses: actions/checkout@v4
@@ -90,8 +96,7 @@ jobs:
9096
echo 'EOF' >> $GITHUB_OUTPUT
9197
9298
output-benchmark:
93-
needs:
94-
- benchmark
99+
needs: benchmark
95100
runs-on: ubuntu-latest
96101
permissions:
97102
pull-requests: write

.github/workflows/plugins-ci-kafka.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ on:
2323
required: false
2424
default: false
2525
type: boolean
26+
node-versions:
27+
description: 'A JSON array that specifies the Node.js versions on which the job should run.'
28+
required: false
29+
default: '["18", "20", "21"]'
30+
type: string
2631

2732
jobs:
2833
dependency-review:
@@ -96,7 +101,7 @@ jobs:
96101
runs-on: ubuntu-latest
97102
strategy:
98103
matrix:
99-
node-version: [18, 20, 21]
104+
node-version: ${{ fromJson(inputs.node-versions) }}
100105
services:
101106
zookeeper:
102107
image: 'confluentinc/cp-zookeeper:7.4.3'

.github/workflows/plugins-ci-mongo.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ on:
2323
required: false
2424
default: false
2525
type: boolean
26+
node-versions:
27+
description: 'A JSON array that specifies the Node.js versions on which the job should run.'
28+
required: false
29+
default: '["18", "20", "21"]'
30+
type: string
2631

2732
jobs:
2833
dependency-review:
@@ -93,15 +98,13 @@ jobs:
9398

9499
test:
95100
name: Node.js ${{ matrix.node-version }} - ${{ matrix.db }}
96-
runs-on: ${{ matrix.os }}
101+
runs-on: ubuntu-latest
97102
permissions:
98103
contents: read
99104
strategy:
100105
matrix:
101-
node-version: [18, 20, 21]
102-
os: [ubuntu-latest]
106+
node-version: ${{ fromJson(inputs.node-versions) }}
103107
db: [5]
104-
105108
services:
106109
mongo:
107110
image: mongo:${{ matrix.db }}

.github/workflows/plugins-ci-mysql.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ on:
2323
required: false
2424
default: false
2525
type: boolean
26+
node-versions:
27+
description: 'A JSON array that specifies the Node.js versions on which the job should run.'
28+
required: false
29+
default: '["18", "20", "21"]'
30+
type: string
2631

2732
jobs:
2833
dependency-review:
@@ -95,15 +100,13 @@ jobs:
95100

96101
test:
97102
name: Node.js ${{ matrix.node-version }} - ${{ matrix.db }}
98-
runs-on: ${{ matrix.os }}
103+
runs-on: ubuntu-latest
99104
permissions:
100105
contents: read
101106
strategy:
102107
matrix:
103-
node-version: [18, 20, 21]
104-
os: [ubuntu-latest]
108+
node-version: ${{ fromJson(inputs.node-versions) }}
105109
db: ['mysql:8.0']
106-
107110
services:
108111
mysql:
109112
image: ${{ matrix.db }}

.github/workflows/plugins-ci-package-manager.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ name: Plugin CI - Package Managers
22

33
on:
44
workflow_call:
5+
inputs:
6+
node-versions:
7+
description: 'A JSON array that specifies the Node.js versions on which the job should run.'
8+
required: false
9+
default: '["18", "20", "21"]'
10+
type: string
511

612
jobs:
713
pnpm:
@@ -11,7 +17,7 @@ jobs:
1117
contents: read
1218
strategy:
1319
matrix:
14-
node-version: [18, 20, 21]
20+
node-version: ${{ fromJson(inputs.node-versions) }}
1521
os: [ubuntu-latest]
1622
pnpm-version: [8]
1723

@@ -44,7 +50,7 @@ jobs:
4450
contents: read
4551
strategy:
4652
matrix:
47-
node-version: [18, 20, 21]
53+
node-version: ${{ fromJson(inputs.node-versions) }}
4854
os: [ubuntu-latest]
4955
steps:
5056
- name: Check out repo

.github/workflows/plugins-ci-postgres.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ on:
2323
required: false
2424
default: false
2525
type: boolean
26+
node-versions:
27+
description: 'A JSON array that specifies the Node.js versions on which the job should run.'
28+
required: false
29+
default: '["18", "20", "21"]'
30+
type: string
2631

2732
jobs:
2833
dependency-review:
@@ -93,15 +98,13 @@ jobs:
9398

9499
test:
95100
name: Node.js ${{ matrix.node-version }} - ${{ matrix.db }}
96-
runs-on: ${{ matrix.os }}
101+
runs-on: ubuntu-latest
97102
permissions:
98103
contents: read
99104
strategy:
100105
matrix:
101-
node-version: [18, 20, 21]
102-
os: [ubuntu-latest]
106+
node-version: ${{ fromJson(inputs.node-versions) }}
103107
db: ['postgres:11-alpine']
104-
105108
services:
106109
postgres:
107110
image: ${{ matrix.db }}

.github/workflows/plugins-ci-redis.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ on:
2323
required: false
2424
default: false
2525
type: boolean
26+
node-versions:
27+
description: 'A JSON array that specifies the Node.js versions on which the job should run.'
28+
required: false
29+
default: '["18", "20", "21"]'
30+
type: string
2631

2732
jobs:
2833
dependency-review:
@@ -96,7 +101,7 @@ jobs:
96101
runs-on: ubuntu-latest
97102
strategy:
98103
matrix:
99-
node-version: [18, 20, 21]
104+
node-version: ${{ fromJson(inputs.node-versions) }}
100105
db: [5, 6, 7]
101106
services:
102107
redis:

.github/workflows/plugins-ci.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ on:
2828
required: false
2929
default: false
3030
type: boolean
31+
node-versions:
32+
description: 'A JSON array that specifies the Node.js versions on which the job should run.'
33+
required: false
34+
default: '["18", "20", "21"]'
35+
type: string
3136

3237
jobs:
3338
dependency-review:
@@ -103,7 +108,7 @@ jobs:
103108
contents: read
104109
strategy:
105110
matrix:
106-
node-version: [18, 20, 21]
111+
node-version: ${{ fromJson(inputs.node-versions) }}
107112
os: [macos-latest, ubuntu-latest, windows-latest]
108113
steps:
109114
- name: Check out repo

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,11 @@ jobs:
6464

6565
| Input Name | Required | Type | Default | Description |
6666
| ---------------------------------- | ---------- | ------- | --------- | ---------------------------------------------------------------------------------- |
67-
| `auto-merge-exclude` | false | string | `fastify` | Provide a semicolon separated list of packages that you do not want to be auto-merged. |
68-
| `license-check` | false | boolean | `false` | Set to `true` to check that a repository's production dependencies use permissive licenses: 0BSD, Apache-2.0, BSD-2-Clause, BSD-3-Clause, MIT, or ISC. |
69-
| `license-check-allowed-additional` | false | string | | Provide a semicolon separated list of SPDX-license identifiers that you want to additionally allow. |
70-
| `lint` | false | boolean | `false` | Set to `true` to run the `lint` script in a repository's `package.json`. |
67+
| `auto-merge-exclude` | false | string | `fastify` | Provide a semicolon separated list of packages that you do not want to be auto-merged. |
68+
| `license-check` | false | boolean | `false` | Set to `true` to check that a repository's production dependencies use permissive licenses: 0BSD, Apache-2.0, BSD-2-Clause, BSD-3-Clause, MIT, or ISC. |
69+
| `license-check-allowed-additional` | false | string | | Provide a semicolon separated list of SPDX-license identifiers that you want to additionally allow. |
70+
| `lint` | false | boolean | `false` | Set to `true` to run the `lint` script in a repository's `package.json`. |
71+
| `node-versions` | false | string | `'["18", "20", "21"]'` | Provide A JSON array that specifies the Node.js versions on which the job should run. |
7172

7273
## Benchmark PR workflow
7374

@@ -92,8 +93,7 @@ jobs:
9293
9394
remove-label:
9495
if: "always()"
95-
needs:
96-
- benchmark
96+
needs: benchmark
9797
runs-on: ubuntu-latest
9898
steps:
9999
- name: Remove benchmark label
@@ -112,6 +112,7 @@ jobs:
112112
| Input Name | Required | Type | Default | Description |
113113
| ---------------------------------- | ---------- | ------- | ----------- | ---------------------------------------------------------------------------------- |
114114
| `npm-script` | false | string | `benchmark` | Provide the name of the npm script to run |
115+
| `node-versions` | false | string | `'["18", "20", "21"]'` | Provide A JSON array that specifies the Node.js versions on which the job should run. |
115116

116117

117118
## Acknowledgements

0 commit comments

Comments
 (0)