Skip to content

test: add integration suite against real PostgreSQL and MySQL #353

test: add integration suite against real PostgreSQL and MySQL

test: add integration suite against real PostgreSQL and MySQL #353

Workflow file for this run

name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
postgres:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version:
- 24
- 26
os:
- ubuntu-latest
postgres-version:
- 14
- 15
- 16
- 17
- 18
name: "Node ${{ matrix.node-version }} - PostgreSQL ${{ matrix.postgres-version }}"
services:
postgres:
image: postgres:${{ matrix.postgres-version }}-alpine
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: sqlmap
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s
--health-retries 5
env:
PGPASS: postgres
PGUSER: postgres
PGDB: sqlmap
PGHOST: localhost
steps:
- name: Checkout source code
uses: actions/checkout@v6
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
- name: Install
run: npm install
- name: Lint
run: npm run lint
- name: Test
run: npm test
- name: Test Integration (PostgreSQL)
run: npm run test:integration:pg
- name: Test Security
run: npm run test:security
# mysql2 supports modern caching_sha2_password auth, so it runs against the
# current MySQL releases.
mysql2:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version:
- 24
- 26
os:
- ubuntu-latest
mysql-version:
- 8
- 9
name: "Node ${{ matrix.node-version }} - mysql2 - MySQL ${{ matrix.mysql-version }}"
services:
mysql:
image: mysql:${{ matrix.mysql-version }}
env:
MYSQL_ROOT_PASSWORD: mysql
MYSQL_DATABASE: sqlmap
ports:
- 3306:3306
options: --health-cmd "mysqladmin ping -h 127.0.0.1 -uroot -pmysql --silent"
--health-interval 10s --health-timeout 5s --health-retries 10
env:
MYSQLHOST: 127.0.0.1
MYSQLUSER: root
MYSQLPASS: mysql
MYSQLDB: sqlmap
steps:
- name: Checkout source code
uses: actions/checkout@v6
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
- name: Install
run: npm install
- name: Test Integration (mysql2)
run: npm run test:integration:mysql2
# The legacy `mysql` driver only supports mysql_native_password, which is
# removed/disabled in MySQL 8.4+/9, so it is pinned to MySQL 8.0.
mysql:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version:
- 24
- 26
os:
- ubuntu-latest
name: "Node ${{ matrix.node-version }} - mysql - MySQL 8.0"
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: mysql
MYSQL_DATABASE: sqlmap
ports:
- 3306:3306
options: --health-cmd "mysqladmin ping -h 127.0.0.1 -uroot -pmysql --silent"
--health-interval 10s --health-timeout 5s --health-retries 10
env:
# The legacy driver reads the MYSQLLEGACY* namespace; point it at the
# 8.0 service on the default port.
MYSQLLEGACYHOST: 127.0.0.1
MYSQLLEGACYPORT: 3306
MYSQLLEGACYUSER: root
MYSQLLEGACYPASS: mysql
MYSQLLEGACYDB: sqlmap
steps:
- name: Checkout source code
uses: actions/checkout@v6
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
- name: Install
run: npm install
- name: Test Integration (mysql legacy)
run: npm run test:integration:mysql
automerge:
needs:
- postgres
- mysql2
- mysql
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
steps:
- uses: fastify/github-action-merge-dependabot@v3