Skip to content

Commit 297b559

Browse files
committed
ci: e2e 테스트 설정
1 parent 45b3eb9 commit 297b559

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# 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
22
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
33

4-
name: Node.js CI
4+
name: CI Test
55

66
on:
77
push:
@@ -10,13 +10,22 @@ on:
1010
branches: [main]
1111

1212
jobs:
13-
build:
13+
ci-test:
1414
runs-on: ubuntu-latest
1515

1616
strategy:
1717
matrix:
1818
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
2029

2130
steps:
2231
- uses: actions/checkout@v4
@@ -27,4 +36,10 @@ jobs:
2736
cache: 'npm'
2837
- run: npm ci
2938
- 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
44+
- name: npm run ${{ matrix.workspace }}
45+
run: npm run ${{ matrix.workspace }}

0 commit comments

Comments
 (0)