@@ -11,44 +11,121 @@ env:
1111 MYSQL_DATABASE : sequelize
1212 MYSQL_PASSWORD : password
1313
14+ MARIADB_USER : sequelize
15+ MARIADB_DATABASE : sequelize
16+ MARIADB_PASSWORD : password
17+
1418jobs :
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
1631
32+ test-sqlite :
1733 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
48+
49+ test-postgres :
50+ runs-on : ubuntu-latest
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
1856
1957 services :
2058 postgres :
21- image : postgres:12.12
59+ image : postgres:${{ matrix.postgres-version }}
2260 env :
2361 POSTGRES_USER : ${{ env.POSTGRES_USER }}
2462 POSTGRES_PASSWORD : ${{ env.POSTGRES_PASSWORD }}
2563 POSTGRES_DB : ${{ env.POSTGRES_DB }}
2664 ports :
2765 - 5432:5432
28- # needed because the postgres container does not provide a healthcheck
2966 options : --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
3067
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 :
3188 mysql :
32- image : mysql:8.4
89+ image : mysql:${{ matrix.mysql-version }}
3390 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
3791 MYSQL_DATABASE : ${{ env.MYSQL_DATABASE }}
3892 MYSQL_ROOT_PASSWORD : ${{ env.MYSQL_PASSWORD }}
3993 MYSQL_USER : ${{ env.MYSQL_USER }}
4094 MYSQL_PASSWORD : ${{ env.MYSQL_PASSWORD }}
4195 ports :
42- # Opens port 3306 on service container and host
43- # https://docs.github.com/en/actions/using-containerized-services/about-service-containers
4496 - 3306:3306
45- # Before continuing, verify the mysql container is reachable from the ubuntu host
4697 options : --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries 5
4798
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+
48113 strategy :
49114 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="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries 5
52129
53130 steps :
54131 - uses : actions/checkout@v3
@@ -57,6 +134,19 @@ jobs:
57134 with :
58135 node-version : ${{ matrix.node-version }}
59136 - 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 build
61151 env :
62152 CI : true
0 commit comments