Skip to content

Commit 19d99a7

Browse files
feat: update minimum supported Node version to 18 (#403)
Currently all active and maintenance versions of Node are 18, 20, 22.
1 parent edb840e commit 19d99a7

File tree

5 files changed

+19
-73
lines changed

5 files changed

+19
-73
lines changed

.github/workflows/coverage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ jobs:
2828
with:
2929
ref: ${{ github.base_ref }}
3030

31-
- name: Setup nodejs
31+
- name: Setup Node
3232
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
3333
with:
34-
node-version: "18.x"
34+
node-version: 18
3535

3636
- name: Install dependencies
3737
run: npm install

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ jobs:
2828
- name: Checkout code
2929
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3030

31-
- name: Use Nodejs v18.x
31+
- name: Setup Node
3232
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
3333
with:
34-
node-version: v18.x
34+
node-version: 18
3535

3636
- name: Install dependencies
3737
run: npm install

.github/workflows/tests.yml

Lines changed: 13 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,8 @@ jobs:
3030
name: Unit tests
3131
strategy:
3232
matrix:
33-
node-version: [v14.x, v16.x, v20.x]
33+
node-version: [18, 20, 22]
3434
os: [ubuntu-latest, macos-latest, windows-latest]
35-
exclude:
36-
- os: windows-latest
37-
node-version: "v14.x"
38-
- os: macos-latest
39-
node-version: "v14.x"
4035
fail-fast: false
4136

4237
runs-on: ${{ matrix.os }}
@@ -71,47 +66,35 @@ jobs:
7166
- name: Transpile TypeScript
7267
run: npm run prepare
7368

74-
# the following steps are node14-only and can be safely removed
75-
# once node@14 is no longer supported
76-
- name: Setup v14.x-compatible tap
77-
if: "${{ matrix.node-version == 'v14.x' }}"
78-
run: npm uninstall @typescript-eslint/eslint-plugin eslint-plugin-prettier tap && npm install tap@16 ts-node && npx npm@7 pkg delete tap
79-
80-
- name: Run Tests v14.x
81-
if: "${{ matrix.node-version == 'v14.x' }}"
82-
run: npx tap -c -t0 --no-coverage --no-ts --node-arg="--require" --node-arg="./scripts/tap16-adapter.js" --node-arg="--no-warnings" --node-arg="--loader" --node-arg="ts-node/esm" test
83-
timeout-minutes: 5
84-
8569
- name: Run Tests
8670
env:
8771
TAP_DISABLE_COVERAGE: "1"
8872
TAP_ALLOW_MISSING_COVERAGE: "1"
8973
TAP_ALLOW_INCOMPLETE_COVERAGE: "1"
9074
TAP_ALLOW_EMPTY_COVERAGE: "1"
91-
if: "${{ matrix.node-version != 'v14.x' }}"
9275
run: npx tap -c -t0 -o test_results.tap test
9376
timeout-minutes: 5
9477

9578
- name: Convert test output to XML
96-
if: ${{ matrix.node-version != 'v14.x' && (github.event_name == 'schedule' || github.event_name == 'push') && always() }}
79+
if: ${{ (github.event_name == 'schedule' || github.event_name == 'push') && always() }}
9780
run: cat test_results.tap | npx tap - --reporter=junit > sponge_log.xml
9881

9982
- name: FlakyBot (Linux)
10083
# only run flakybot on periodic (schedule) and continuous (push) events
101-
if: ${{ matrix.node-version != 'v14.x' && (github.event_name == 'schedule' || github.event_name == 'push') && runner.os == 'Linux' && always() }}
84+
if: ${{ (github.event_name == 'schedule' || github.event_name == 'push') && runner.os == 'Linux' && always() }}
10285
run: |
10386
curl https://github.com/googleapis/repo-automation-bots/releases/download/flakybot-1.1.0/flakybot -o flakybot -s -L
10487
chmod +x ./flakybot
10588
./flakybot --repo ${{github.repository}} --commit_hash ${{github.sha}} --build_url https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
10689
- name: FlakyBot (Windows)
10790
# only run flakybot on periodic (schedule) and continuous (push) events
108-
if: ${{ matrix.node-version != 'v14.x' && (github.event_name == 'schedule' || github.event_name == 'push') && runner.os == 'Windows' && always() }}
91+
if: ${{ (github.event_name == 'schedule' || github.event_name == 'push') && runner.os == 'Windows' && always() }}
10992
run: |
11093
curl https://github.com/googleapis/repo-automation-bots/releases/download/flakybot-1.1.0/flakybot.exe -o flakybot.exe -s -L
11194
./flakybot.exe --repo ${{github.repository}} --commit_hash ${{github.sha}} --build_url https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
11295
- name: FlakyBot (macOS)
11396
# only run flakybot on periodic (schedule) and continuous (push) events
114-
if: ${{ matrix.node-version != 'v14.x' && (github.event_name == 'schedule' || github.event_name == 'push') && runner.os == 'macOS' && always() }}
97+
if: ${{ (github.event_name == 'schedule' || github.event_name == 'push') && runner.os == 'macOS' && always() }}
11598
run: |
11699
curl https://github.com/googleapis/repo-automation-bots/releases/download/flakybot-1.1.0/flakybot-darwin-amd64 -o flakybot -s -L
117100
chmod +x ./flakybot
@@ -125,17 +108,12 @@ jobs:
125108
(github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]')
126109
strategy:
127110
matrix:
128-
node-version: [v14.x, v16.x, v20.x]
111+
node-version: [18, 20, 22]
129112
os: [ubuntu-latest, macos-latest, windows-latest]
130-
exclude:
131-
- os: windows-latest
132-
node-version: "v14.x"
133-
- os: macos-latest
134-
node-version: "v14.x"
135113
fail-fast: false
136114
permissions:
137-
contents: "read"
138-
id-token: "write"
115+
contents: read
116+
id-token: write
139117
issues: write
140118
pull-requests: write
141119

@@ -188,42 +166,12 @@ jobs:
188166
SQLSERVER_PASS:${{ vars.GOOGLE_CLOUD_PROJECT }}/SQLSERVER_PASS
189167
SQLSERVER_DB:${{ vars.GOOGLE_CLOUD_PROJECT }}/SQLSERVER_DB
190168
191-
# the following steps are node14-only and can be safely removed
192-
# once node@14 is no longer supported
193-
- name: Setup v14.x-compatible tap
194-
if: "${{ matrix.node-version == 'v14.x' }}"
195-
run: npm uninstall @typescript-eslint/eslint-plugin eslint-plugin-prettier tap && npm install tap@16 ts-node && npx npm@7 pkg delete tap
196-
197169
- name: Setup self-direct dependency
198170
run: npm link
199171

200172
- name: Link self-direct dependency
201173
run: npm link @google-cloud/cloud-sql-connector
202174

203-
- name: Run System Tests v14.x
204-
env:
205-
MYSQL_CONNECTION_NAME: "${{ steps.secrets.outputs.MYSQL_CONNECTION_NAME }}"
206-
MYSQL_IAM_CONNECTION_NAME: "${{ steps.secrets.outputs.MYSQL_IAM_CONNECTION_NAME }}"
207-
MYSQL_USER: "${{ steps.secrets.outputs.MYSQL_USER }}"
208-
MYSQL_IAM_USER: "${{ steps.secrets.outputs.MYSQL_IAM_USER }}"
209-
MYSQL_PASS: "${{ steps.secrets.outputs.MYSQL_PASS }}"
210-
MYSQL_DB: "${{ steps.secrets.outputs.MYSQL_DB }}"
211-
POSTGRES_CONNECTION_NAME: "${{ steps.secrets.outputs.POSTGRES_CONNECTION_NAME }}"
212-
POSTGRES_IAM_CONNECTION_NAME: "${{ steps.secrets.outputs.POSTGRES_IAM_CONNECTION_NAME }}"
213-
POSTGRES_USER: "${{ steps.secrets.outputs.POSTGRES_USER }}"
214-
POSTGRES_IAM_USER: "${{ steps.secrets.outputs.POSTGRES_IAM_USER }}"
215-
POSTGRES_PASS: "${{ steps.secrets.outputs.POSTGRES_PASS }}"
216-
POSTGRES_DB: "${{ steps.secrets.outputs.POSTGRES_DB }}"
217-
POSTGRES_CAS_CONNECTION_NAME: "${{ steps.secrets.outputs.POSTGRES_CAS_CONNECTION_NAME }}"
218-
POSTGRES_CAS_PASS: "${{ steps.secrets.outputs.POSTGRES_CAS_PASS }}"
219-
SQLSERVER_CONNECTION_NAME: "${{ steps.secrets.outputs.SQLSERVER_CONNECTION_NAME }}"
220-
SQLSERVER_USER: "${{ steps.secrets.outputs.SQLSERVER_USER }}"
221-
SQLSERVER_PASS: "${{ steps.secrets.outputs.SQLSERVER_PASS }}"
222-
SQLSERVER_DB: "${{ steps.secrets.outputs.SQLSERVER_DB }}"
223-
if: "${{ matrix.node-version == 'v14.x' }}"
224-
run: npx tap -c -t0 --no-coverage --no-ts --node-arg="--require" --node-arg="./scripts/tap16-adapter.js" --node-arg="--no-warnings" --node-arg="--loader" --node-arg="ts-node/esm" system-test -o test_results.tap
225-
timeout-minutes: 5
226-
227175
- name: Run System Tests
228176
env:
229177
MYSQL_CONNECTION_NAME: "${{ steps.secrets.outputs.MYSQL_CONNECTION_NAME }}"
@@ -244,30 +192,29 @@ jobs:
244192
SQLSERVER_USER: "${{ steps.secrets.outputs.SQLSERVER_USER }}"
245193
SQLSERVER_PASS: "${{ steps.secrets.outputs.SQLSERVER_PASS }}"
246194
SQLSERVER_DB: "${{ steps.secrets.outputs.SQLSERVER_DB }}"
247-
if: "${{ matrix.node-version != 'v14.x' }}"
248195
run: npx tap -c -t0 --disable-coverage --allow-empty-coverage system-test -o test_results.tap
249196
timeout-minutes: 5
250197

251198
- name: Convert test output to XML
252-
if: ${{ matrix.node-version != 'v14.x' && (github.event_name == 'schedule' || github.event_name == 'push') && always() }}
199+
if: ${{ (github.event_name == 'schedule' || github.event_name == 'push') && always() }}
253200
run: cat test_results.tap | npx tap - --reporter=junit > sponge_log.xml
254201

255202
- name: FlakyBot (Linux)
256203
# only run flakybot on periodic (schedule) and continuous (push) events
257-
if: ${{ matrix.node-version != 'v14.x' && (github.event_name == 'schedule' || github.event_name == 'push') && runner.os == 'Linux' && always() }}
204+
if: ${{ (github.event_name == 'schedule' || github.event_name == 'push') && runner.os == 'Linux' && always() }}
258205
run: |
259206
curl https://github.com/googleapis/repo-automation-bots/releases/download/flakybot-1.1.0/flakybot -o flakybot -s -L
260207
chmod +x ./flakybot
261208
./flakybot --repo ${{github.repository}} --commit_hash ${{github.sha}} --build_url https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
262209
- name: FlakyBot (Windows)
263210
# only run flakybot on periodic (schedule) and continuous (push) events
264-
if: ${{ matrix.node-version != 'v14.x' && (github.event_name == 'schedule' || github.event_name == 'push') && runner.os == 'Windows' && always() }}
211+
if: ${{ (github.event_name == 'schedule' || github.event_name == 'push') && runner.os == 'Windows' && always() }}
265212
run: |
266213
curl https://github.com/googleapis/repo-automation-bots/releases/download/flakybot-1.1.0/flakybot.exe -o flakybot.exe -s -L
267214
./flakybot.exe --repo ${{github.repository}} --commit_hash ${{github.sha}} --build_url https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
268215
- name: FlakyBot (macOS)
269216
# only run flakybot on periodic (schedule) and continuous (push) events
270-
if: ${{ matrix.node-version != 'v14.x' && (github.event_name == 'schedule' || github.event_name == 'push') && runner.os == 'macOS' && always() }}
217+
if: ${{ (github.event_name == 'schedule' || github.event_name == 'push') && runner.os == 'macOS' && always() }}
271218
run: |
272219
curl https://github.com/googleapis/repo-automation-bots/releases/download/flakybot-1.1.0/flakybot-darwin-amd64 -o flakybot -s -L
273220
chmod +x ./flakybot
@@ -291,13 +238,12 @@ jobs:
291238
- name: Setup Node.js
292239
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
293240
with:
294-
node-version: v20.x
241+
node-version: 18
295242

296243
- name: Install dependencies
297244
run: npm ci
298245

299246
- name: Install Prisma on node v16.x and up
300-
if: "${{ matrix.node-version != 'v14.x' }}"
301247
run: npm install prisma
302248

303249
- name: Setup self-direct dependency

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"typescript": "^5.1.6"
7979
},
8080
"engines": {
81-
"node": ">=14"
81+
"node": ">=18"
8282
},
8383
"repository": {
8484
"type": "git",

0 commit comments

Comments
 (0)