Skip to content

Commit

Permalink
chore: pr ci checker 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
GHooN99 committed Oct 9, 2024
1 parent fd6203a commit 2df80a7
Show file tree
Hide file tree
Showing 6 changed files with 152 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## 작업 내용 요약

- 작성

### 참고자료

- 작성
39 changes: 39 additions & 0 deletions .github/workflows/cache-modules.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: cache-modules
run-name: node_modules update

on:
push:
branches:
- main
- develop

jobs:
update-cache:
timeout-minutes: 10
name: update-cache
runs-on: ubuntu-latest

steps:
- name: 체크아웃
uses: actions/checkout@v4

- name: node 세팅
uses: actions/setup-node@v4
with:
node-version: '20.15.1'
npm: '10.8.1'

- name: 의존성 캐싱
uses: actions/cache@v3
id: npm-cache
with:
path: |
**/node_modules
key: ${{ runner.os }}-nodekey-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-nodekey-
- name: 의존성 설치
if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm install
99 changes: 99 additions & 0 deletions .github/workflows/ci-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: CI-check
run-name: CI by @${{ github.actor }}

on:
pull_request:
branches:
- main
- develop
types:
- opened
- synchronize
- reopened
- ready_for_review
permissions:
pull-requests: write
contents: read

jobs:
setup:
name: CI 작업 세팅
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: 체크아웃
uses: actions/checkout@v4

- name: node 세팅
uses: actions/setup-node@v4
with:
node-version: '20.15.1'
npm: '10.8.1'

- name: 의존성 캐싱
uses: actions/cache@v3
id: npm-cache
with:
path: |
**/node_modules
key: ${{ runner.os }}-nodekey-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-nodekey-
- if: ${{ steps.npm-cache.outputs.cache-hit != 'true' }}
run: npm install

lint:
name: lint 체크
timeout-minutes: 10
runs-on: ubuntu-latest
needs: setup
steps:
- name: 체크아웃
uses: actions/checkout@v4

- name: node 세팅
uses: actions/setup-node@v4
with:
node-version: '20.15.1'
npm: '10.8.1'

- name: 의존성 캐싱
uses: actions/cache@v3
id: npm-cache
with:
path: |
**/node_modules
key: ${{ runner.os }}-nodekey-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-nodekey-
- name: ESLint 실행
run: npm run lint

type-check:
name: 타입 체킹
timeout-minutes: 10
runs-on: ubuntu-latest
needs: setup
steps:
- name: 체크아웃
uses: actions/checkout@v4

- name: node 세팅
uses: actions/setup-node@v4
with:
node-version: '20.15.1'
npm: '10.8.1'

- name: 의존성 캐싱
uses: actions/cache@v3
id: npm-cache
with:
path: |
**/node_modules
key: ${{ runner.os }}-nodekey-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-nodekey-
- name: 타입 체크
run: npm run type-check
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,19 @@
"lint": "eslint .",
"lint-staged": "lint-staged",
"preview": "vite preview",
"prepare": "husky"
"prepare": "husky",
"type-check": "tsc -p tsconfig.app.json --noEmit"
},
"prepare": "husky install",
"lint-staged": {
"**/*.{ts,tsx}": [
"prettier --write"
]
},
"engines": {
"node": ">=20",
"npm": ">=10"
},
"dependencies": {
"@reduxjs/toolkit": "^2.2.8",
"axios": "^1.7.7",
Expand Down
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ function App() {
</div>
);
}

const a: number = '@';
export default App;
2 changes: 0 additions & 2 deletions tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@

/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"baseUrl": "./src",
"paths": {
Expand Down

0 comments on commit 2df80a7

Please sign in to comment.