-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (75 loc) · 2 KB
/
dev.ci.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
name: Dev Server Backend/Frontend CI
run-name: ${{ github.actor }} is building DevServer
on:
push:
paths:
- 'backend/**'
- 'frontend/**'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:latest
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: test
MYSQL_USER: user
MYSQL_PASSWORD: password
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Filter Backend/Frontend
uses: dorny/[email protected]
id: changes
with:
filters: |
backend:
- 'backend/**'
frontend:
- 'frontend/**'
- name: install node
uses: actions/setup-node@v3
with:
node-version: '20'
- name: DevServer Backend CI(Unit Test)
if: steps.changes.outputs.backend == 'true'
run: |
cd ./backend
npm install
npm run build
NODE_ENV=CI npm run test
cd ..
- name: DevServer Backend CI(E2E Test)
if: steps.changes.outputs.backend == 'true'
env:
DATABASE_HOST: 127.0.0.1
DATABASE_PORT: 3306
DATABASE_USER: root
DATABASE_PASSWORD: password
DATABASE_NAME: test
JWT_SECRET: JWT_SECRET
GITHUB_CLIENT_ID: GITHUB_CLIENT_ID
GITHUB_CLIENT_SECRETS: GITHUB_CLIENT_SECRETS
run: |
cd ./backend
npm install
npm run build
NODE_ENV=CI npm run test:e2e
cd ..
- name: DevServer Frontend CI
if: steps.changes.outputs.frontend == 'true' && always()
run: |
cd ./frontend
npm install
npm run build
npm run test
cd ..