π¨ Feat: λμ보λ μμΈ νμ΄μ§ - μ€μΌλ ν€ UI μ μ© #138
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI Pipeline | |
| on: | |
| pull_request: | |
| branches: [develop, main] | |
| push: | |
| branches: [develop, main] | |
| jobs: | |
| eslint-check: | |
| runs-on: self-hosted | |
| timeout-minutes: 2 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 2 # HEADμ λ² μ΄μ€ λΈλμΉ νμ€ν 리 ν보 | |
| - name: Lightning fast lint check | |
| run: | | |
| echo "β‘ Quick lint check..." | |
| # λ©λͺ¨λ¦¬ μν μ¬μ μ²΄ν¬ | |
| AVAILABLE_MB=$(free -m | grep ^Mem | awk '{print $7}') | |
| echo "πΎ Available memory: ${AVAILABLE_MB}MB" | |
| if [ "${{ github.event_name }}" = "pull_request" ]; then | |
| # PRμΈ κ²½μ°: λ² μ΄μ€ λΈλμΉμ λΉκ΅ | |
| BASE_BRANCH="${{ github.base_ref }}" | |
| git fetch origin $BASE_BRANCH --depth=1 | |
| ALL_CHANGED=$(git diff --name-only origin/$BASE_BRANCH...HEAD -- '*.ts' '*.tsx' '*.js' '*.jsx') | |
| FILE_COUNT=$(echo "$ALL_CHANGED" | wc -w) | |
| echo "π Base: $BASE_BRANCH, Changed files: $FILE_COUNT" | |
| # π‘οΈ λ©λͺ¨λ¦¬ κΈ°λ° μμ μ₯μΉ | |
| if [ "$AVAILABLE_MB" -lt 200 ]; then | |
| MAX_FILES=10 | |
| echo "β οΈ Low memory mode: checking $MAX_FILES files only" | |
| elif [ "$FILE_COUNT" -gt 30 ]; then | |
| MAX_FILES=30 | |
| echo "β οΈ Large PR detected: checking first $MAX_FILES files for memory safety" | |
| echo "βΉοΈ Note: Full project will be built during deployment" | |
| else | |
| MAX_FILES="$FILE_COUNT" | |
| echo "β Normal mode: checking all $FILE_COUNT files" | |
| fi | |
| CHANGED_FILES=$(echo "$ALL_CHANGED" | head -$MAX_FILES) | |
| else | |
| # PushμΈ κ²½μ°: μ΄μ 컀λ°κ³Ό λΉκ΅ | |
| echo "π Push event detected" | |
| if git rev-parse --verify HEAD~1 >/dev/null 2>&1; then | |
| CHANGED_FILES=$(git diff --name-only HEAD~1 -- '*.ts' '*.tsx' '*.js' '*.jsx') | |
| echo "π Checking files changed since last commit" | |
| else | |
| echo "π First commit or shallow clone, checking recent files" | |
| CHANGED_FILES=$(find . -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" | grep -v node_modules | head -5) | |
| fi | |
| fi | |
| # λ³κ²½μ¬ν μμΌλ©΄ μ¦μ μ’ λ£ | |
| if [ -z "$CHANGED_FILES" ]; then | |
| echo "β No JS/TS files to check" | |
| exit 0 | |
| fi | |
| # μ΅μ’ μ€ν μ 보 | |
| FINAL_COUNT=$(echo $CHANGED_FILES | wc -w) | |
| ESTIMATED_MB=$((FINAL_COUNT * 2)) | |
| echo "π§ Checking $FINAL_COUNT files (~${ESTIMATED_MB}MB estimated)" | |
| echo "π Files: $CHANGED_FILES" | |
| # κΈλ‘λ² ESLint μ€ν | |
| npx eslint $CHANGED_FILES | |
| echo "β Lint check passed!" |