Skip to content

ci: add previous MySQL versions to integration tests matrix #61

ci: add previous MySQL versions to integration tests matrix

ci: add previous MySQL versions to integration tests matrix #61

name: "Integration Tests"
on:
pull_request:
types: [opened, reopened, synchronize]
push:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}
cancel-in-progress: true
jobs:
integration-test:
runs-on: ubuntu-latest
strategy:
matrix:
node: [18, 20, 22]
mysql: ["5", "lts"]
name: Node ${{ matrix.node }} with MySQL ${{ matrix.mysql }} Integration Tests
timeout-minutes: 5
services:
mysql:
image: mysql:${{ matrix.mysql }}
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: serverless_mysql_test
MYSQL_ROOT_HOST: "%"
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
steps:
- name: "Checkout latest code"
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: npm ci
- name: Run unit tests
run: npm run test:unit
- name: Run integration tests
run: npm run test:integration
env:
MYSQL_HOST: 127.0.0.1
MYSQL_PORT: 3306
MYSQL_DATABASE: serverless_mysql_test
MYSQL_USER: root
MYSQL_PASSWORD: password
- name: Run all tests with coverage
if: matrix.node == 22 && matrix.mysql == 'lts'
run: npm run test-cov
env:
MYSQL_HOST: 127.0.0.1
MYSQL_PORT: 3306
MYSQL_DATABASE: serverless_mysql_test
MYSQL_USER: root
MYSQL_PASSWORD: password