-
Notifications
You must be signed in to change notification settings - Fork 8
69 lines (59 loc) · 1.77 KB
/
frontend-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
name: Frontend CI
on:
pull_request:
branches: ['develop']
permissions:
checks: write
pull-requests: write
jobs:
detect-changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
backend: ${{ steps.filter.outputs.backend }}
frontend: ${{ steps.filter.outputs.frontend }}
steps:
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
backend:
- 'backend/**'
frontend:
- 'frontend/**'
list-files: 'csv'
fe-test:
needs: detect-changes
if: ${{ needs.detect-changes.outputs.frontend == 'true' }}
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: ./frontend
steps:
- name: 모모 레파지토리의 코드를 가져와요 :)
uses: actions/checkout@v4
- name: 노드 버젼을 설정해요 :)
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- name: 이전 의존성을 저장해둔게 있나~? 확인해요 :)
id: cache
uses: actions/cache@v4
with:
path: 'frontend/node_modules'
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
${{ runner.os }}
- name: package-lock.json을 활용해서 의존성을 깨끗하게 설치해요 :)
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci
- name: RTL을 실행해요 :)
run: npm run test -- --passWithNoTests
- name: 테스트 결과를 PR에 코멘트로 등록해요 :)
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: frontend/reports/**/*.xml