Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions .github/workflows/npm-install-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: NPM Install Test

on:
pull_request:
branches: [main]
types: [opened, synchronize, reopened]
Comment on lines +5 to +6
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

디폴트라서 불필요합니다.

Copy link
Member

@DaleSeo DaleSeo Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

release -> main PR이 생성되었을때 npm pack 을 사용하여 install 가능 여부 테스트

혹시나 해서 티켓 내용을 보니 이벤트가 잘못 설정되어 있네요. 현재 설정은 base 브랜치가 main으로 잡고 PR을 생성/재성성/변경 때 마다 워크플로우가 실행됩니다. 요구사항대로 구현하려면 push 이벤트를 사용해서 워크플로우 실행 시점을 잡아야할 것 같습니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DaleSeo 님,

install-test:
    if: ${{ startsWith(github.head_ref, 'release/') }}

이 코드가 추가되어있어 "release/x.y.z" 에서 main브랜치로 PR생성/커밋 추가 등 업데이트/PR이 재오픈될때 워크플로우가 실행되도록 설정해두었습니다~!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

디폴트라서 불필요합니다.

옷, 이 부분 아직 반영이 안 된 것 같네요.


jobs:
install-test:
if: ${{ startsWith(github.head_ref, 'release/') }}
strategy:
fail-fast: false # 하나 실패해도 나머지는 계속 돌리게
matrix:
include:
- name: "Create React App (React 18)"
project: cra
node: "lts/*"

- name: "Vite + React"
project: vite
node: "lts/*"

runs-on: ubuntu-latest
name: ${{ matrix.name }}

steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install dependencies & Build
run: |
bun install
bun run build

# ========================================
# 테스트 프로젝트 생성 + daleui 설치 + 빌드
# ========================================
- name: Create test project & install daleui
run: |
mkdir /tmp/test-project && cd /tmp/test-project

case "${{ matrix.project }}" in
cra)
bunx --yes create-react-app@latest . --template typescript
;;
vite)
bunx --yes create vite@5 . --template react-ts
;;
esac

# 강제로 로컬 daleui 패키지 설치
bun add "$GITHUB_WORKSPACE"

# ========================================
# 실제로 daleui 써보는 smoke test 페이지 추가
# ========================================
- name: Add daleui smoke test
run: |
cd /tmp/test-project
mkdir -p src/smoke
cat > src/smoke/DaleTest.tsx << 'EOF'
import React from 'react';
import { Button } from 'daleui';

export default function DaleTest() {
return (
<div data-testid="daleui-smoke">
<Button>daleui 성공적으로 로드됨!</Button>
</div>
);
}
EOF

# ========================================
# 최종 빌드 테스트
# ========================================
- name: Run production build
run: |
cd /tmp/test-project
bun run build