[pull] master from sidorares:master #830
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI - Linux | |
on: | |
pull_request: | |
push: | |
branches: [main] | |
workflow_dispatch: | |
env: | |
MYSQL_PORT: 3306 | |
MYSQL_USER: root | |
MYSQL_DATABASE: test | |
jobs: | |
tests-linux: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
node-version: [18.x, 20.x, 22.x, 23.x] | |
mysql-version: ['mysql:8.0.33'] | |
use-compression: [0, 1] | |
use-tls: [0, 1] | |
mysql_connection_url_key: [''] | |
# TODO - add mariadb to the matrix. currently few tests are broken due to mariadb incompatibilities | |
env: | |
MYSQL_CONNECTION_URL: ${{ secrets[matrix.mysql_connection_url_key] }} | |
name: Node.js ${{ matrix.node-version }} - DB ${{ matrix.mysql-version }}${{ matrix.mysql_connection_url_key }} - SSL=${{matrix.use-tls}} Compression=${{matrix.use-compression}} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up MySQL | |
if: ${{ matrix.mysql-version }} | |
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 Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- 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 | |
if: ${{ matrix.mysql-version }} | |
run: node tools/wait-up.js | |
- name: Run tests | |
run: FILTER=${{matrix.filter}} MYSQL_USE_TLS=${{ matrix.use-tls }} MYSQL_USE_COMPRESSION=${{ matrix.use-compression }} npm run test | |
timeout-minutes: 5 | |
tests-linux-bun: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
bun-version: [latest, canary] | |
mysql-version: ['mysql:8.0.33'] | |
use-compression: [0, 1] | |
use-tls: [0, 1] | |
name: Bun ${{ matrix.bun-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 Bun ${{ matrix.bun-version }} | |
uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: ${{ matrix.bun-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 | |
# todo: run full test suite once test createServer is implemented using Bun.listen | |
- 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 }} | |
FILTER: test-select-1|test-select-ssl | |
run: bun run test:bun | |
timeout-minutes: 1 | |
tests-linux-deno-v1: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
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) | |
# | |
# 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 | |
timeout-minutes: 5 |