Skip to content

Commit 430eaf7

Browse files
authored
Merge pull request #5 from toothlessdev/3-setup-github-action-ci-workflow-yarn-berry-turbo-repo
Setup GitHub action ci workflow (yarn berry & turborepo)
2 parents 9233c20 + f2aebec commit 430eaf7

16 files changed

Lines changed: 197 additions & 106 deletions

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
## 📎 Related issues
22

3-
- resolve #
3+
- resolve #
4+
5+
## 📦 Scope
6+
7+
<!--이번 변경으로 영향을 받는 패키지를 선택해주세요.-->
8+
9+
- [ ] @patchlogr/core
10+
- [ ] @patchlogr/cli
11+
- [ ] @patchlogr/inspector
12+
- [ ] @patchlogr/oas
13+
- [ ] @patchlogr/types
14+
- [ ] docs, examples
15+
- [ ] tests
16+
- [ ] ci / cd / infra
17+
- [ ] other (아래에 명시)
418

519
## 📦 Scope
620
<!--이번 변경으로 영향을 받는 패키지를 선택해주세요.-->
@@ -35,6 +49,6 @@
3549

3650
## ✅ Checklist
3751

38-
- [ ] 요구사항 명세 충족
39-
- [ ] 테스트 추가 / 수정
40-
- [ ] deterministic output 확인
52+
- [ ] 요구사항 명세 충족
53+
- [ ] 테스트 추가 / 수정
54+
- [ ] deterministic output 확인

.github/workflows/ci.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Continuous Integration
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
checks: write
11+
actions: read
12+
pull-requests: write
13+
14+
env:
15+
NODE_VERSION: "24"
16+
17+
jobs:
18+
build-and-test:
19+
name: Build & Test
20+
timeout-minutes: 15
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- name: Checkout Code
25+
uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 0
28+
29+
- name: Setup Node.js
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: ${{ env.NODE_VERSION }}
33+
34+
- name: Enable Corepack (Yarn Berry)
35+
run: corepack enable
36+
37+
- name: Setup Yarn Berry
38+
run: yarn set version 4.12.0
39+
40+
- name: Restore Yarn Cache
41+
uses: actions/cache@v4
42+
with:
43+
path: |
44+
.yarn/cache
45+
.yarn/unplugged
46+
.yarn/build-state.yml
47+
.pnp.cjs
48+
key: yarn-${{runner.os}}-${{hashFiles('**/yarn.lock')}}
49+
restore-keys: yarn-${{runner.os}}-
50+
51+
- name: Install Dependencies (Yarn Berry)
52+
run: yarn install --immutable
53+
54+
- name: Restore Turborepo Cache
55+
uses: actions/cache@v4
56+
with:
57+
path: .turbo
58+
key: turbo-${{runner.os}}-${{hashFiles('turbo.json', 'package.json', '**/package.json')}}
59+
restore-keys: turbo-${{runner.os}}-
60+
61+
- name: Run Typecheck
62+
run: yarn typecheck
63+
64+
- name: Run Lint
65+
run: yarn lint
66+
67+
- name: Run Tests
68+
run: yarn test
69+
70+
- name: Report Test Logs
71+
uses: dorny/test-reporter@v1
72+
if: (!cancelled())
73+
with:
74+
name: Test Logs
75+
path: "**/.coverage/report.xml"
76+
reporter: java-junit
77+
78+
- name: Upload Test Artifacts
79+
uses: actions/upload-artifact@v4
80+
if: (!cancelled())
81+
with:
82+
name: Test Reports
83+
path: |
84+
**/.coverage/report.xml
85+
**/coverage/**/*
86+
retention-days: 7
87+
88+
- name: Publish Test Results
89+
uses: EnricoMi/publish-unit-test-result-action@v2
90+
if: (!cancelled())
91+
with:
92+
files: "**/.coverage/report.xml"

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,7 @@ node_modules
2020
.turbo
2121

2222
# build files
23-
dist
23+
dist
24+
25+
# test files
26+
.coverage

eslint.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export default tseslint.config(
1313
"**/coverage/**",
1414
"**/.yarn/**",
1515
"**/.pnp.*",
16+
"**/*.mjs",
1617
],
1718
},
1819
js.configs.recommended,

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,19 @@
66
"packages/*"
77
],
88
"scripts": {
9-
"dev": "turbo run dev",
10-
"build": "turbo run build",
11-
"test": "turbo run test",
12-
"lint": "turbo run lint",
13-
"typecheck": "turbo run typecheck",
9+
"dev": "turbo run dev --cache-dir=.turbo",
10+
"build": "turbo run build --cache-dir=.turbo",
11+
"test": "turbo run test --cache-dir=.turbo",
12+
"lint": "turbo run lint --cache-dir=.turbo",
13+
"typecheck": "turbo run typecheck --cache-dir=.turbo",
1414
"clean": "turbo run clean && rm -rf node_modules .turbo"
1515
},
1616
"devDependencies": {
1717
"@eslint/js": "^9.39.2",
1818
"@types/node": "24",
1919
"@typescript-eslint/eslint-plugin": "^8.51.0",
2020
"@typescript-eslint/parser": "^8.51.0",
21+
"@vitest/ui": "^4.0.16",
2122
"esbuild": "0.27.2",
2223
"eslint": "^9.39.2",
2324
"eslint-config-prettier": "^10.1.8",

packages/patchlogr-oas/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
},
77
"scripts": {
88
"lint": "eslint .",
9-
"test": "vitest"
9+
"test": "vitest",
10+
"typecheck": "tsc --noEmit"
1011
},
1112
"devDependencies": {
1213
"@types/node": "24",

packages/patchlogr-oas/src/pipeline/OASCanonicalizeStage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { OASStageContext } from "./OASStageContext";
33
import { PipelineStage } from "./PipelineExecutor";
44
import { canonicalizeOASV2 } from "../canonicalize/v2";
55
import { canonicalizeOASV3 } from "../canonicalize/v3";
6-
import { isOpenAPIV2, isOpenAPIV3 } from "../utils/OASVersionUtils";
6+
import { isOpenAPIV2, isOpenAPIV3 } from "../utils/oasVersionUtils";
77

88
/**
99
* 표준화된 CanonicalSpec로 변환

packages/patchlogr-oas/src/pipeline/OASValidationStage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import SwaggerParser from "@apidevtools/swagger-parser";
22

33
import { PipelineStage } from "./PipelineExecutor";
44
import { OASStageContext } from "./OASStageContext";
5-
import { getOASVersion } from "../utils/OASVersionUtils";
5+
import { getOASVersion } from "../utils/oasVersionUtils";
66

77
/**
88
* OAS 문서의 유효성 검사

packages/patchlogr-oas/src/utils/OASVersionUtils.ts

Lines changed: 0 additions & 18 deletions
This file was deleted.

packages/patchlogr-oas/src/utils/__tests__/OASVersionUtils.test.ts

Lines changed: 0 additions & 68 deletions
This file was deleted.

0 commit comments

Comments
 (0)