Skip to content

์Šคํ† ๋ฆฌ ๋ทฐ์–ด์—์„œ ๊ธฐ๋ณธ ํ”„๋กœํ•„ ์‚ฌ์ง„ ํ‘œ์‹œ #110

์Šคํ† ๋ฆฌ ๋ทฐ์–ด์—์„œ ๊ธฐ๋ณธ ํ”„๋กœํ•„ ์‚ฌ์ง„ ํ‘œ์‹œ

์Šคํ† ๋ฆฌ ๋ทฐ์–ด์—์„œ ๊ธฐ๋ณธ ํ”„๋กœํ•„ ์‚ฌ์ง„ ํ‘œ์‹œ #110

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
})