forked from sidorares/node-mysql2
-
Notifications
You must be signed in to change notification settings - Fork 0
160 lines (132 loc) · 5.38 KB
/
ci-linux.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
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]
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
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:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
deno-version: [v1.43.6, canary]
mysql-version: ["mysql:8.0.33"]
use-compression: [0, 1]
use-tls: [0,1]
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
# todo: check what we need to do to run all tests with deno
- 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 test --allow-net --allow-env --allow-read test/deno.ts
timeout-minutes: 1