You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2
2
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3
3
4
-
name: Node.js CI
4
+
name: CI Test
5
5
6
6
on:
7
7
push:
@@ -10,13 +10,22 @@ on:
10
10
branches: [main]
11
11
12
12
jobs:
13
-
build:
13
+
ci-test:
14
14
runs-on: ubuntu-latest
15
15
16
16
strategy:
17
17
matrix:
18
18
node-version: [20.x]
19
-
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
19
+
workspace: ['test:unit', 'test:e2e']
20
+
21
+
services:
22
+
mysql:
23
+
image: mysql:8.0.23
24
+
ports:
25
+
- 3307:3306
26
+
env:
27
+
MYSQL_DATABASE: e_commerce_test
28
+
MYSQL_ROOT_PASSWORD: root
20
29
21
30
steps:
22
31
- uses: actions/checkout@v4
@@ -27,4 +36,10 @@ jobs:
27
36
cache: 'npm'
28
37
- run: npm ci
29
38
- run: npm run build --if-present
30
-
- run: npm test
39
+
- name: init database
40
+
run: |
41
+
sudo /etc/init.d/mysql start
42
+
mysql -h 127.0.0.1 -P 3307 -uroot -proot -e "CREATE DATABASE IF NOT EXISTS e_commerce_test;"
43
+
mysql -h 127.0.0.1 -P 3307 -uroot -proot e_commerce_test < ./docker/mysql/init-backend.sql
0 commit comments