From 1c1880f7c90cc810f5cf971945fde52708318613 Mon Sep 17 00:00:00 2001 From: wellwelwel <46850407+wellwelwel@users.noreply.github.com> Date: Thu, 14 Nov 2024 19:53:05 -0300 Subject: [PATCH 1/4] fix: Deno requires explict `commonjs` type --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index da2375e420..77feb9991c 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "description": "fast mysql driver. Implements core protocol, prepared statements, ssl and compression in native JS", "main": "index.js", "typings": "typings/mysql/index", + "type": "commonjs", "scripts": { "lint": "npm run lint:docs && npm run lint:code", "lint:code": "eslint index.js promise.js index.d.ts promise.d.ts \"typings/**/*.ts\" \"lib/**/*.js\" \"test/**/*.{js,cjs,mjs,ts}\" \"benchmarks/**/*.js\"", From 0ff2012cad7cb2e09feac94c81060a8744fda43f Mon Sep 17 00:00:00 2001 From: wellwelwel <46850407+wellwelwel@users.noreply.github.com> Date: Thu, 14 Nov 2024 20:03:27 -0300 Subject: [PATCH 2/4] debug: remove polyfill --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 77feb9991c..0a7cac26d0 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "lint:tests": "npx prettier --check ./test", "test": "poku --debug --include=\"test/esm,test/unit,test/integration\"", "test:bun": "poku --debug --platform=\"bun\" --include=\"test/esm,test/unit,test/integration\"", - "test:deno": "deno run --allow-read --allow-env --allow-run npm:poku --debug --platform=\"deno\" --deno-allow=\"read,env,net,sys\" --deno-cjs=\".js,.cjs\" --include=\"test/esm,test/unit,test/integration\"", + "test:deno": "deno run --allow-read --allow-env --allow-run npm:poku --debug --platform=\"deno\" --deno-allow=\"read,env,net,sys\" --include=\"test/esm,test/unit,test/integration\"", "test:tsc-build": "cd \"test/tsc-build\" && npx tsc -p \"tsconfig.json\"", "coverage-test": "c8 npm run test", "benchmark": "node ./benchmarks/benchmark.js", From 2292c2548e6db147786d7948356ea33c263dfba5 Mon Sep 17 00:00:00 2001 From: wellwelwel <46850407+wellwelwel@users.noreply.github.com> Date: Thu, 14 Nov 2024 20:13:41 -0300 Subject: [PATCH 3/4] ci: use short flags --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 0a7cac26d0..a3a0c0bd19 100644 --- a/package.json +++ b/package.json @@ -11,9 +11,9 @@ "lint:docs": "eslint Contributing.md README.md", "lint:typings": "npx prettier --check ./typings", "lint:tests": "npx prettier --check ./test", - "test": "poku --debug --include=\"test/esm,test/unit,test/integration\"", - "test:bun": "poku --debug --platform=\"bun\" --include=\"test/esm,test/unit,test/integration\"", - "test:deno": "deno run --allow-read --allow-env --allow-run npm:poku --debug --platform=\"deno\" --deno-allow=\"read,env,net,sys\" --include=\"test/esm,test/unit,test/integration\"", + "test": "poku -d test/esm test/unit test/integration", + "test:bun": "poku -d --bun test/esm test/unit test/integration", + "test:deno": "deno run --allow-read --allow-env --allow-run npm:poku -d --deno --deno-allow=\"read,env,net,sys\" test/esm test/unit test/integration", "test:tsc-build": "cd \"test/tsc-build\" && npx tsc -p \"tsconfig.json\"", "coverage-test": "c8 npm run test", "benchmark": "node ./benchmarks/benchmark.js", From ad4551a6b2f01b31ed41c1eb20531b0efb756b2b Mon Sep 17 00:00:00 2001 From: wellwelwel <46850407+wellwelwel@users.noreply.github.com> Date: Thu, 14 Nov 2024 20:45:08 -0300 Subject: [PATCH 4/4] ci: detach Deno v1 from Deno workflow --- .github/workflows/ci-linux.yml | 58 ++++++++++++++++++++++++++++++++-- package.json | 2 +- 2 files changed, 57 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index 53d137bc35..bf010d9b06 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -110,12 +110,66 @@ jobs: run: bun run test:bun timeout-minutes: 1 - tests-linux-deno: + tests-linux-deno-v1: runs-on: ubuntu-latest strategy: fail-fast: false matrix: - deno-version: [v1.x, v2.x, canary] + deno-version: [v1.x] + mysql-version: ['mysql:8.0.33'] + use-compression: [0, 1] + # TODO: investigate error when using SSL (1) + # + # errno: -4094 + # code: "UNKNOWN" + # syscall: "read" + use-tls: [0] + + name: Deno ${{ matrix.deno-version }} - DB ${{ matrix.mysql-version }} - SSL=${{matrix.use-tls}} Compression=${{matrix.use-compression}} + + steps: + - uses: actions/checkout@v4 + - name: Set up MySQL + run: docker run -d -e MYSQL_ALLOW_EMPTY_PASSWORD=1 -e MYSQL_DATABASE=${{ env.MYSQL_DATABASE }} -v $PWD/mysqldata:/var/lib/mysql/ -v $PWD/test/fixtures/custom-conf:/etc/mysql/conf.d -v $PWD/test/fixtures/ssl/certs:/certs -p ${{ env.MYSQL_PORT }}:3306 ${{ matrix.mysql-version }} + + - name: Set up Deno ${{ matrix.deno-version }} + uses: denoland/setup-deno@v1 + with: + deno-version: ${{ matrix.deno-version }} + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + - name: Cache dependencies + uses: actions/cache@v4 + with: + path: ~/.npm + key: npm-linux-${{ hashFiles('package-lock.json') }} + restore-keys: npm-linux- + + - name: Install npm dependencies + run: npm ci + + - name: Wait mysql server is ready + run: node tools/wait-up.js + + - name: run tests + env: + MYSQL_USER: ${{ env.MYSQL_USER }} + MYSQL_DATABASE: ${{ env.MYSQL_DATABASE }} + MYSQL_PORT: ${{ env.MYSQL_PORT }} + MYSQL_USE_COMPRESSION: ${{ matrix.use-compression }} + MYSQL_USE_TLS: ${{ matrix.use-tls }} + run: deno task test:deno -- --denoCjs='.js,.cjs' + timeout-minutes: 5 + + tests-linux-deno-v2: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + deno-version: [v2.x, canary] mysql-version: ['mysql:8.0.33'] use-compression: [0, 1] # TODO: investigate error when using SSL (1) diff --git a/package.json b/package.json index a3a0c0bd19..d4e74b18d8 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "lint:tests": "npx prettier --check ./test", "test": "poku -d test/esm test/unit test/integration", "test:bun": "poku -d --bun test/esm test/unit test/integration", - "test:deno": "deno run --allow-read --allow-env --allow-run npm:poku -d --deno --deno-allow=\"read,env,net,sys\" test/esm test/unit test/integration", + "test:deno": "deno run --allow-read --allow-env --allow-run npm:poku -d --deno --denoAllow=\"read,env,net,sys\" test/esm test/unit test/integration", "test:tsc-build": "cd \"test/tsc-build\" && npx tsc -p \"tsconfig.json\"", "coverage-test": "c8 npm run test", "benchmark": "node ./benchmarks/benchmark.js",