diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 1c140fec..d805da8c 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -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 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b85f2527..07a189d9 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -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 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 68315f55..44af4e02 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 }} @@ -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 @@ -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 @@ -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 }}" @@ -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 @@ -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 diff --git a/package-lock.json b/package-lock.json index e25a8e8e..af9ad365 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,7 +36,7 @@ "typescript": "^5.1.6" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "node_modules/@aashutoshrathi/word-wrap": { diff --git a/package.json b/package.json index 73c54d3f..d1175ecf 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "typescript": "^5.1.6" }, "engines": { - "node": ">=14" + "node": ">=18" }, "repository": { "type": "git",