-
-
Notifications
You must be signed in to change notification settings - Fork 625
70 lines (59 loc) · 2.11 KB
/
ci-mysql.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: CI - MySQL
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: [20.x] # LTS
mysql-version:
[
'mysql:5.7',
'mysql:8.0.18',
'mysql:8.0.22',
'mysql:8.0.33',
'mysql:latest',
]
use-compression: [0, 1]
use-tls: [0, 1]
mysql_connection_url_key: ['']
include:
## MySQL 5.1: A number of tests does not work due to old sql syntax, just testing basic connection
- filter: 'test-select-1'
mysql-version: 'datagrip/mysql:5.1'
use-compression: 0
use-tls: 0
env:
MYSQL_CONNECTION_URL: ${{ secrets[matrix.mysql_connection_url_key] }}
name: ${{ 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