Skip to content

Commit

Permalink
feat: update minimum supported Node version to 18 (#403)
Browse files Browse the repository at this point in the history
Currently all active and maintenance versions of Node are 18, 20, 22.
  • Loading branch information
jackwotherspoon authored Dec 11, 2024
1 parent edb840e commit 19d99a7
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 73 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ jobs:
with:
ref: ${{ github.base_ref }}

- name: Setup nodejs
- name: Setup Node
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: "18.x"
node-version: 18

- name: Install dependencies
run: npm install
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ jobs:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

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

- name: Install dependencies
run: npm install
Expand Down
80 changes: 13 additions & 67 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,8 @@ jobs:
name: Unit tests
strategy:
matrix:
node-version: [v14.x, v16.x, v20.x]
node-version: [18, 20, 22]
os: [ubuntu-latest, macos-latest, windows-latest]
exclude:
- os: windows-latest
node-version: "v14.x"
- os: macos-latest
node-version: "v14.x"
fail-fast: false

runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -71,47 +66,35 @@ jobs:
- name: Transpile TypeScript
run: npm run prepare

# the following steps are node14-only and can be safely removed
# once node@14 is no longer supported
- name: Setup v14.x-compatible tap
if: "${{ matrix.node-version == 'v14.x' }}"
run: npm uninstall @typescript-eslint/eslint-plugin eslint-plugin-prettier tap && npm install tap@16 ts-node && npx npm@7 pkg delete tap

- name: Run Tests v14.x
if: "${{ matrix.node-version == 'v14.x' }}"
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
timeout-minutes: 5

- name: Run Tests
env:
TAP_DISABLE_COVERAGE: "1"
TAP_ALLOW_MISSING_COVERAGE: "1"
TAP_ALLOW_INCOMPLETE_COVERAGE: "1"
TAP_ALLOW_EMPTY_COVERAGE: "1"
if: "${{ matrix.node-version != 'v14.x' }}"
run: npx tap -c -t0 -o test_results.tap test
timeout-minutes: 5

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

- name: FlakyBot (Linux)
# only run flakybot on periodic (schedule) and continuous (push) events
if: ${{ matrix.node-version != 'v14.x' && (github.event_name == 'schedule' || github.event_name == 'push') && runner.os == 'Linux' && always() }}
if: ${{ (github.event_name == 'schedule' || github.event_name == 'push') && runner.os == 'Linux' && always() }}
run: |
curl https://github.com/googleapis/repo-automation-bots/releases/download/flakybot-1.1.0/flakybot -o flakybot -s -L
chmod +x ./flakybot
./flakybot --repo ${{github.repository}} --commit_hash ${{github.sha}} --build_url https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
- name: FlakyBot (Windows)
# only run flakybot on periodic (schedule) and continuous (push) events
if: ${{ matrix.node-version != 'v14.x' && (github.event_name == 'schedule' || github.event_name == 'push') && runner.os == 'Windows' && always() }}
if: ${{ (github.event_name == 'schedule' || github.event_name == 'push') && runner.os == 'Windows' && always() }}
run: |
curl https://github.com/googleapis/repo-automation-bots/releases/download/flakybot-1.1.0/flakybot.exe -o flakybot.exe -s -L
./flakybot.exe --repo ${{github.repository}} --commit_hash ${{github.sha}} --build_url https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
- name: FlakyBot (macOS)
# only run flakybot on periodic (schedule) and continuous (push) events
if: ${{ matrix.node-version != 'v14.x' && (github.event_name == 'schedule' || github.event_name == 'push') && runner.os == 'macOS' && always() }}
if: ${{ (github.event_name == 'schedule' || github.event_name == 'push') && runner.os == 'macOS' && always() }}
run: |
curl https://github.com/googleapis/repo-automation-bots/releases/download/flakybot-1.1.0/flakybot-darwin-amd64 -o flakybot -s -L
chmod +x ./flakybot
Expand All @@ -125,17 +108,12 @@ jobs:
(github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]')
strategy:
matrix:
node-version: [v14.x, v16.x, v20.x]
node-version: [18, 20, 22]
os: [ubuntu-latest, macos-latest, windows-latest]
exclude:
- os: windows-latest
node-version: "v14.x"
- os: macos-latest
node-version: "v14.x"
fail-fast: false
permissions:
contents: "read"
id-token: "write"
contents: read
id-token: write
issues: write
pull-requests: write

Expand Down Expand Up @@ -188,42 +166,12 @@ jobs:
SQLSERVER_PASS:${{ vars.GOOGLE_CLOUD_PROJECT }}/SQLSERVER_PASS
SQLSERVER_DB:${{ vars.GOOGLE_CLOUD_PROJECT }}/SQLSERVER_DB
# the following steps are node14-only and can be safely removed
# once node@14 is no longer supported
- name: Setup v14.x-compatible tap
if: "${{ matrix.node-version == 'v14.x' }}"
run: npm uninstall @typescript-eslint/eslint-plugin eslint-plugin-prettier tap && npm install tap@16 ts-node && npx npm@7 pkg delete tap

- name: Setup self-direct dependency
run: npm link

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

- name: Run System Tests v14.x
env:
MYSQL_CONNECTION_NAME: "${{ steps.secrets.outputs.MYSQL_CONNECTION_NAME }}"
MYSQL_IAM_CONNECTION_NAME: "${{ steps.secrets.outputs.MYSQL_IAM_CONNECTION_NAME }}"
MYSQL_USER: "${{ steps.secrets.outputs.MYSQL_USER }}"
MYSQL_IAM_USER: "${{ steps.secrets.outputs.MYSQL_IAM_USER }}"
MYSQL_PASS: "${{ steps.secrets.outputs.MYSQL_PASS }}"
MYSQL_DB: "${{ steps.secrets.outputs.MYSQL_DB }}"
POSTGRES_CONNECTION_NAME: "${{ steps.secrets.outputs.POSTGRES_CONNECTION_NAME }}"
POSTGRES_IAM_CONNECTION_NAME: "${{ steps.secrets.outputs.POSTGRES_IAM_CONNECTION_NAME }}"
POSTGRES_USER: "${{ steps.secrets.outputs.POSTGRES_USER }}"
POSTGRES_IAM_USER: "${{ steps.secrets.outputs.POSTGRES_IAM_USER }}"
POSTGRES_PASS: "${{ steps.secrets.outputs.POSTGRES_PASS }}"
POSTGRES_DB: "${{ steps.secrets.outputs.POSTGRES_DB }}"
POSTGRES_CAS_CONNECTION_NAME: "${{ steps.secrets.outputs.POSTGRES_CAS_CONNECTION_NAME }}"
POSTGRES_CAS_PASS: "${{ steps.secrets.outputs.POSTGRES_CAS_PASS }}"
SQLSERVER_CONNECTION_NAME: "${{ steps.secrets.outputs.SQLSERVER_CONNECTION_NAME }}"
SQLSERVER_USER: "${{ steps.secrets.outputs.SQLSERVER_USER }}"
SQLSERVER_PASS: "${{ steps.secrets.outputs.SQLSERVER_PASS }}"
SQLSERVER_DB: "${{ steps.secrets.outputs.SQLSERVER_DB }}"
if: "${{ matrix.node-version == 'v14.x' }}"
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
timeout-minutes: 5

- name: Run System Tests
env:
MYSQL_CONNECTION_NAME: "${{ steps.secrets.outputs.MYSQL_CONNECTION_NAME }}"
Expand All @@ -244,30 +192,29 @@ jobs:
SQLSERVER_USER: "${{ steps.secrets.outputs.SQLSERVER_USER }}"
SQLSERVER_PASS: "${{ steps.secrets.outputs.SQLSERVER_PASS }}"
SQLSERVER_DB: "${{ steps.secrets.outputs.SQLSERVER_DB }}"
if: "${{ matrix.node-version != 'v14.x' }}"
run: npx tap -c -t0 --disable-coverage --allow-empty-coverage system-test -o test_results.tap
timeout-minutes: 5

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

- name: FlakyBot (Linux)
# only run flakybot on periodic (schedule) and continuous (push) events
if: ${{ matrix.node-version != 'v14.x' && (github.event_name == 'schedule' || github.event_name == 'push') && runner.os == 'Linux' && always() }}
if: ${{ (github.event_name == 'schedule' || github.event_name == 'push') && runner.os == 'Linux' && always() }}
run: |
curl https://github.com/googleapis/repo-automation-bots/releases/download/flakybot-1.1.0/flakybot -o flakybot -s -L
chmod +x ./flakybot
./flakybot --repo ${{github.repository}} --commit_hash ${{github.sha}} --build_url https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
- name: FlakyBot (Windows)
# only run flakybot on periodic (schedule) and continuous (push) events
if: ${{ matrix.node-version != 'v14.x' && (github.event_name == 'schedule' || github.event_name == 'push') && runner.os == 'Windows' && always() }}
if: ${{ (github.event_name == 'schedule' || github.event_name == 'push') && runner.os == 'Windows' && always() }}
run: |
curl https://github.com/googleapis/repo-automation-bots/releases/download/flakybot-1.1.0/flakybot.exe -o flakybot.exe -s -L
./flakybot.exe --repo ${{github.repository}} --commit_hash ${{github.sha}} --build_url https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
- name: FlakyBot (macOS)
# only run flakybot on periodic (schedule) and continuous (push) events
if: ${{ matrix.node-version != 'v14.x' && (github.event_name == 'schedule' || github.event_name == 'push') && runner.os == 'macOS' && always() }}
if: ${{ (github.event_name == 'schedule' || github.event_name == 'push') && runner.os == 'macOS' && always() }}
run: |
curl https://github.com/googleapis/repo-automation-bots/releases/download/flakybot-1.1.0/flakybot-darwin-amd64 -o flakybot -s -L
chmod +x ./flakybot
Expand All @@ -291,13 +238,12 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: v20.x
node-version: 18

- name: Install dependencies
run: npm ci

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

- name: Setup self-direct dependency
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"typescript": "^5.1.6"
},
"engines": {
"node": ">=14"
"node": ">=18"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 19d99a7

Please sign in to comment.