-
Notifications
You must be signed in to change notification settings - Fork 2
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
[Feat] PR lint, tsc, prettier 검사 workflow 구현 #120
Changes from all commits
55fc415
6becd26
b2f2b29
58b6ddb
1382738
993ef17
c853e7a
ac88102
3b9d2f4
0980f5c
93b2634
d724b58
69191e1
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,41 @@ | ||
name: Check PR | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
- develop | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Branch | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: latest | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18' | ||
cache: 'pnpm' | ||
|
||
- name: Install Packages | ||
run: pnpm install --frozen-lockfile | ||
|
||
- name: Run Check Scripts | ||
run: | | ||
set -o pipefail | ||
pnpm run check | tee check.log | ||
|
||
- name: Print Summary | ||
run: | | ||
echo "## Check Result" >> $GITHUB_STEP_SUMMARY | ||
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY | ||
echo "$(cat check.log)" >> $GITHUB_STEP_SUMMARY | ||
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,12 +4,14 @@ | |
"scripts": { | ||
"dev": "turbo dev", | ||
"lint": "turbo lint", | ||
"typecheck": "turbo typecheck", | ||
"build": "turbo run build", | ||
"build:apps": "turbo run build --filter=./apps/*", | ||
"build:packages": "turbo run build --filter=./packages/*", | ||
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md}\"", | ||
"format:check": "prettier --check \"**/*.{js,jsx,ts,tsx,json,md}\"", | ||
"prepare": "husky" | ||
"prepare": "husky", | ||
"check": "turbo run lint typecheck format:check --parallel" | ||
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. turpo.json 을 통해 script에 대한 명령를 정의할 수 있지않나요? lint와 typecheck를 같이 진행하는 이유가 있을까요? 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.
이 말씀은 아래처럼 check script를 turbo.json으로 옮겼으면 좋겠다는 말씀이실까요?! // turbo.json
{
"tasks": {
"check": {
"dependsOn": ["lint", "typecheck", "format:check"],
"cache": true
}
}
}
// package.json
{
"scripts": {
"check": "turbo run check"
}
} 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.
이 workflow의 목적이 PR에 대해 lint, tsc, prettier 검사를 하는것이기 때문에 같이 진행하는것인데 |
||
}, | ||
"devDependencies": { | ||
"husky": "^9.1.6", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,5 +43,6 @@ module.exports = { | |
}, | ||
}, | ||
], | ||
'import/newline-after-import': 'error', | ||
}, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export const shards = { | ||
export const shared = { | ||
asdasd: 1, | ||
asdww: 1, | ||
}; |
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.
해당 부분은 어떤 동작을 하나요?
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.
이 workflow의 동작 내용과 결과를 출력하는 코드입니다! PR의 Checks 탭 > Check PR > Summary 에서 볼 수 있습니다