-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FE] ci 워크플로우 구축 #40
[FE] ci 워크플로우 구축 #40
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: Frontend CI Test | ||
|
||
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 아무런 테스트를 진행하지 않는 경우에도, CI 파이프라인이 통과될 수 있도록 하기 위한 설정이군요! 설정 고생하셨습니다 빙봉~ 🔮 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
- name: 테스트 결과를 PR에 코멘트로 등록해요 :) | ||
uses: EnricoMi/publish-unit-test-result-action@v2 | ||
if: always() | ||
with: | ||
files: frontend/test-results/results.xml | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PR 본문에 테스트 결과 표시를 위해서는, |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
노드 버전 설정 관련돼서 설정하는 방법이 https://github.com/actions/setup-node 여기 명시돼있네요!