@@ -11,44 +11,121 @@ env:
11
11
MYSQL_DATABASE : sequelize
12
12
MYSQL_PASSWORD : password
13
13
14
+ MARIADB_USER : sequelize
15
+ MARIADB_DATABASE : sequelize
16
+ MARIADB_PASSWORD : password
17
+
14
18
jobs :
15
- build :
19
+ lint :
20
+ runs-on : ubuntu-latest
21
+ steps :
22
+ - uses : actions/checkout@v4
23
+ - name : Use Node.js
24
+ uses : actions/setup-node@v4
25
+ with :
26
+ node-version : 22.x
27
+ - run : npm install
28
+ - run : npm run lint
29
+ env :
30
+ CI : true
31
+
32
+ test-sqlite :
33
+ runs-on : ubuntu-latest
34
+ strategy :
35
+ matrix :
36
+ node-version : [20.x, 22.x]
37
+
38
+ steps :
39
+ - uses : actions/checkout@v4
40
+ - name : Use Node.js ${{ matrix.node-version }}
41
+ uses : actions/setup-node@v4
42
+ with :
43
+ node-version : ${{ matrix.node-version }}
44
+ - run : npm install
45
+ - run : DB=sqlite npm test
46
+ env :
47
+ CI : true
16
48
49
+ test-postgres :
17
50
runs-on : ubuntu-latest
18
51
52
+ strategy :
53
+ matrix :
54
+ node-version : [20.x, 22.x]
55
+ postgres-version : [14, 15, 16, 17, latest] # see https://hub.docker.com/_/postgres
56
+
19
57
services :
20
58
postgres :
21
- image : postgres:12.12
59
+ image : postgres:${{ matrix.postgres-version }}
22
60
env :
23
61
POSTGRES_USER : ${{ env.POSTGRES_USER }}
24
62
POSTGRES_PASSWORD : ${{ env.POSTGRES_PASSWORD }}
25
63
POSTGRES_DB : ${{ env.POSTGRES_DB }}
26
64
ports :
27
65
- 5432:5432
28
- # needed because the postgres container does not provide a healthcheck
29
66
options : --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
30
67
68
+ steps :
69
+ - uses : actions/checkout@v4
70
+ - name : Use Node.js ${{ matrix.node-version }}
71
+ uses : actions/setup-node@v4
72
+ with :
73
+ node-version : ${{ matrix.node-version }}
74
+ - run : npm install
75
+ - run : DB=postgres npm test
76
+ env :
77
+ CI : true
78
+
79
+ test-mysql :
80
+ runs-on : ubuntu-latest
81
+
82
+ strategy :
83
+ matrix :
84
+ node-version : [20.x, 22.x]
85
+ mysql-version : [lts, latest] # see https://hub.docker.com/_/mysql/
86
+
87
+ services :
31
88
mysql :
32
- image : mysql:8.4
89
+ image : mysql:${{ matrix.mysql-version }}
33
90
env :
34
- # The MySQL docker container requires these environment variables to be set
35
- # so we can create and migrate the test database.
36
- # See: https://hub.docker.com/_/mysql
37
91
MYSQL_DATABASE : ${{ env.MYSQL_DATABASE }}
38
92
MYSQL_ROOT_PASSWORD : ${{ env.MYSQL_PASSWORD }}
39
93
MYSQL_USER : ${{ env.MYSQL_USER }}
40
94
MYSQL_PASSWORD : ${{ env.MYSQL_PASSWORD }}
41
95
ports :
42
- # Opens port 3306 on service container and host
43
- # https://docs.github.com/en/actions/using-containerized-services/about-service-containers
44
96
- 3306:3306
45
- # Before continuing, verify the mysql container is reachable from the ubuntu host
46
97
options : --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries 5
47
98
99
+ steps :
100
+ - uses : actions/checkout@v4
101
+ - name : Use Node.js ${{ matrix.node-version }}
102
+ uses : actions/setup-node@v4
103
+ with :
104
+ node-version : ${{ matrix.node-version }}
105
+ - run : npm install
106
+ - run : DB=mysql npm test
107
+ env :
108
+ CI : true
109
+
110
+ test-mariadb :
111
+ runs-on : ubuntu-latest
112
+
48
113
strategy :
49
114
matrix :
50
- node-version : [18.x, 20.x, 22.x]
51
- database : ['sqlite', 'postgres', 'mysql']
115
+ node-version : [20.x, 22.x]
116
+ mariadb-version : [10, 11, lts, latest] # see https://hub.docker.com/_/mariadb
117
+
118
+ services :
119
+ mariadb :
120
+ image : mariadb:${{ matrix.mariadb-version }}
121
+ env :
122
+ MARIADB_DATABASE : ${{ env.MARIADB_DATABASE }}
123
+ MARIADB_ROOT_PASSWORD : ${{ env.MARIADB_PASSWORD }}
124
+ MARIADB_USER : ${{ env.MARIADB_USER }}
125
+ MARIADB_PASSWORD : ${{ env.MARIADB_PASSWORD }}
126
+ ports :
127
+ - 3306:3306
128
+ options : --health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=3
52
129
53
130
steps :
54
131
- uses : actions/checkout@v3
@@ -57,6 +134,19 @@ jobs:
57
134
with :
58
135
node-version : ${{ matrix.node-version }}
59
136
- run : npm install
60
- - run : DB=${{matrix.database}} npm test
137
+ - run : DB=mariadb npm test
138
+ env :
139
+ CI : true
140
+
141
+ build :
142
+ runs-on : ubuntu-latest
143
+ steps :
144
+ - uses : actions/checkout@v4
145
+ - name : Use Node.js
146
+ uses : actions/setup-node@v4
147
+ with :
148
+ node-version : 22.x
149
+ - run : npm install
150
+ - run : npm run compile
61
151
env :
62
152
CI : true
0 commit comments