Skip to content

ν”„λ‘œν•„ νŽ˜μ΄μ§€ νŒ”λ‘œμš° κ΄€λ ¨ api μ—°κ²° 및 ν•„λ“œλͺ… 였λ₯˜ μˆ˜μ • #57

ν”„λ‘œν•„ νŽ˜μ΄μ§€ νŒ”λ‘œμš° κ΄€λ ¨ api μ—°κ²° 및 ν•„λ“œλͺ… 였λ₯˜ μˆ˜μ •

ν”„λ‘œν•„ νŽ˜μ΄μ§€ νŒ”λ‘œμš° κ΄€λ ¨ api μ—°κ²° 및 ν•„λ“œλͺ… 였λ₯˜ μˆ˜μ • #57

Workflow file for this run

name: CI (PR to dev)
on:
pull_request:
branches:
- dev
jobs:
ci:
name: Lint / Type / Test / Build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Run ESLint
run: yarn lint
- name: Type check
run: yarn type-check
- name: Run tests (Vitest)
env:
VITE_API_URL: ${{ secrets.VITE_API_URL }}
run: yarn test:ci
- name: Build project
env:
VITE_API_URL: ${{ secrets.VITE_API_URL }}
run: yarn build
- name: Comment on PR (CI Result)
if: always()
uses: actions/github-script@v7
with:
script: |
const status = '${{ job.status }}'
const isSuccess = status === 'success'
const runUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`
const body = isSuccess
? `βœ… **CI ν†΅κ³Όν–ˆμŠ΅λ‹ˆλ‹€!**\n\n- Lint / Type / Test / Build λͺ¨λ‘ 성곡\n- dev 브랜치둜 λ¨Έμ§€ κ°€λŠ₯ν•©λ‹ˆλ‹€ πŸš€`
: `❌ **CI μ‹€νŒ¨ν–ˆμŠ΅λ‹ˆλ‹€.**\n\n- 둜그λ₯Ό ν™•μΈν•˜κ³  문제λ₯Ό μˆ˜μ •ν•΄ μ£Όμ„Έμš”.\n- μˆ˜μ • ν›„ λ‹€μ‹œ push ν•˜λ©΄ CIκ°€ μžλ™ μž¬μ‹€ν–‰λ©λ‹ˆλ‹€.\n- [CI μ‹€ν–‰ 둜그 보기](${runUrl})`
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body
})