Skip to content

Commit b5b0e76

Browse files
committed
init
0 parents  commit b5b0e76

247 files changed

Lines changed: 59783 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
trim_trailing_whitespace = true
8+
9+
[*.py]
10+
indent_style = space
11+
indent_size = 4
12+
13+
[*.{yml,yaml}]
14+
indent_style = space
15+
indent_size = 2
16+
17+
[*.{json,md}]
18+
indent_style = space
19+
indent_size = 2
20+
21+
[Makefile]
22+
indent_style = tab
23+
24+
[*.cs]
25+
indent_style = space
26+
indent_size = 4
27+
28+
# C# 코드 스타일
29+
csharp_new_line_before_open_brace = all
30+
csharp_prefer_braces = true
31+
dotnet_sort_system_directives_first = true

.github/workflows/ci-simple.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: CI - Unit Tests
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
env:
10+
DOTNET_VERSION: '8.0.x'
11+
12+
jobs:
13+
unit-tests:
14+
name: Unit Tests
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 10
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Setup .NET
23+
uses: actions/setup-dotnet@v4
24+
with:
25+
dotnet-version: ${{ env.DOTNET_VERSION }}
26+
27+
- name: Restore
28+
run: dotnet restore
29+
30+
- name: Build
31+
run: dotnet build --no-restore --configuration Release
32+
33+
- name: Test Core
34+
run: |
35+
dotnet test tests/CodeBeaker.Core.Tests/ \
36+
--no-build \
37+
--configuration Release \
38+
--logger "console;verbosity=normal"
39+
40+
- name: Test Runtimes
41+
run: |
42+
dotnet test tests/CodeBeaker.Runtimes.Tests/ \
43+
--no-build \
44+
--configuration Release \
45+
--logger "console;verbosity=normal"
46+
47+
code-quality:
48+
name: Code Quality
49+
runs-on: ubuntu-latest
50+
timeout-minutes: 5
51+
52+
steps:
53+
- name: Checkout
54+
uses: actions/checkout@v4
55+
56+
- name: Setup .NET
57+
uses: actions/setup-dotnet@v4
58+
with:
59+
dotnet-version: ${{ env.DOTNET_VERSION }}
60+
61+
- name: Restore
62+
run: dotnet restore
63+
64+
- name: Build
65+
run: dotnet build --no-restore --configuration Release
66+
67+
- name: Format Check
68+
run: dotnet format --verify-no-changes --no-restore

.github/workflows/ci.yml

Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
name: CI Pipeline (Unit Tests Only)
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
workflow_dispatch:
9+
10+
env:
11+
DOTNET_VERSION: '8.0.x'
12+
13+
jobs:
14+
# Job 1: 빌드 및 단위 테스트 (빠른 피드백)
15+
build-and-test:
16+
name: Build and Unit Tests
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Setup .NET
24+
uses: actions/setup-dotnet@v4
25+
with:
26+
dotnet-version: ${{ env.DOTNET_VERSION }}
27+
28+
- name: Cache NuGet packages
29+
uses: actions/cache@v4
30+
with:
31+
path: ~/.nuget/packages
32+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
33+
restore-keys: |
34+
${{ runner.os }}-nuget-
35+
36+
- name: Restore dependencies
37+
run: dotnet restore
38+
39+
- name: Build solution
40+
run: dotnet build --no-restore --configuration Release
41+
42+
- name: Run unit tests
43+
run: |
44+
dotnet test tests/CodeBeaker.Core.Tests/ \
45+
--no-build \
46+
--configuration Release \
47+
--logger "trx;LogFileName=core-test-results.trx" \
48+
--collect:"XPlat Code Coverage" \
49+
--results-directory ./TestResults
50+
51+
- name: Run runtime tests
52+
run: |
53+
dotnet test tests/CodeBeaker.Runtimes.Tests/ \
54+
--no-build \
55+
--configuration Release \
56+
--logger "trx;LogFileName=runtime-test-results.trx" \
57+
--collect:"XPlat Code Coverage" \
58+
--results-directory ./TestResults
59+
60+
- name: Upload test results
61+
uses: actions/upload-artifact@v4
62+
if: always()
63+
with:
64+
name: test-results
65+
path: TestResults/**/*.trx
66+
67+
- name: Upload coverage reports
68+
uses: actions/upload-artifact@v4
69+
if: always()
70+
with:
71+
name: coverage-reports
72+
path: TestResults/**/coverage.cobertura.xml
73+
74+
- name: Publish code coverage
75+
uses: codecov/codecov-action@v4
76+
if: always()
77+
with:
78+
files: ./TestResults/**/coverage.cobertura.xml
79+
flags: unittests
80+
name: codecov-umbrella
81+
fail_ci_if_error: false
82+
83+
# Job 2: 코드 품질 분석
84+
code-quality:
85+
name: Code Quality Analysis
86+
runs-on: ubuntu-latest
87+
needs: build-and-test
88+
89+
steps:
90+
- name: Checkout code
91+
uses: actions/checkout@v4
92+
with:
93+
fetch-depth: 0 # Shallow clones should be disabled for better analysis
94+
95+
- name: Setup .NET
96+
uses: actions/setup-dotnet@v4
97+
with:
98+
dotnet-version: ${{ env.DOTNET_VERSION }}
99+
100+
- name: Restore dependencies
101+
run: dotnet restore
102+
103+
- name: Build solution
104+
run: dotnet build --no-restore --configuration Release
105+
106+
- name: Run code analysis
107+
run: dotnet format --verify-no-changes --no-restore
108+
109+
# Job 3: 보안 스캔
110+
security-scan:
111+
name: Security Scan
112+
runs-on: ubuntu-latest
113+
needs: build-and-test
114+
115+
steps:
116+
- name: Checkout code
117+
uses: actions/checkout@v4
118+
119+
- name: Run Trivy vulnerability scanner
120+
uses: aquasecurity/trivy-action@master
121+
with:
122+
scan-type: 'fs'
123+
scan-ref: '.'
124+
format: 'sarif'
125+
output: 'trivy-results.sarif'
126+
127+
- name: Upload Trivy results to GitHub Security
128+
uses: github/codeql-action/upload-sarif@v3
129+
if: always()
130+
with:
131+
sarif_file: 'trivy-results.sarif'
132+
133+
# Job 4: 벤치마크 (선택적)
134+
benchmarks:
135+
name: Performance Benchmarks
136+
runs-on: ubuntu-latest
137+
needs: build-and-test
138+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
139+
140+
steps:
141+
- name: Checkout code
142+
uses: actions/checkout@v4
143+
144+
- name: Setup .NET
145+
uses: actions/setup-dotnet@v4
146+
with:
147+
dotnet-version: ${{ env.DOTNET_VERSION }}
148+
149+
- name: Run benchmarks
150+
run: |
151+
dotnet run --project benchmarks/CodeBeaker.Benchmarks/CodeBeaker.Benchmarks.csproj \
152+
--configuration Release \
153+
--exporters json
154+
155+
- name: Upload benchmark results
156+
uses: actions/upload-artifact@v4
157+
if: always()
158+
with:
159+
name: benchmark-results
160+
path: BenchmarkDotNet.Artifacts/**/*
161+
162+
# Job 5: 릴리스 준비 (태그 푸시 시)
163+
prepare-release:
164+
name: Prepare Release
165+
runs-on: ubuntu-latest
166+
needs: [build-and-test, code-quality, security-scan]
167+
if: startsWith(github.ref, 'refs/tags/v')
168+
169+
steps:
170+
- name: Checkout code
171+
uses: actions/checkout@v4
172+
173+
- name: Setup .NET
174+
uses: actions/setup-dotnet@v4
175+
with:
176+
dotnet-version: ${{ env.DOTNET_VERSION }}
177+
178+
- name: Build release packages
179+
run: |
180+
dotnet publish src/CodeBeaker.API/CodeBeaker.API.csproj \
181+
--configuration Release \
182+
--output ./publish/api
183+
184+
dotnet publish src/CodeBeaker.Worker/CodeBeaker.Worker.csproj \
185+
--configuration Release \
186+
--output ./publish/worker
187+
188+
- name: Create release archive
189+
run: |
190+
tar -czf codebeaker-${{ github.ref_name }}-linux-x64.tar.gz -C ./publish .
191+
192+
- name: Create GitHub Release
193+
uses: softprops/action-gh-release@v1
194+
with:
195+
files: |
196+
codebeaker-${{ github.ref_name }}-linux-x64.tar.gz
197+
draft: false
198+
prerelease: false
199+
generate_release_notes: true
200+
env:
201+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/docs-deploy.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Deploy Documentation to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'docs/**'
9+
- 'README.md'
10+
- 'docs-site/**'
11+
- '.github/workflows/docs-deploy.yml'
12+
workflow_dispatch:
13+
14+
permissions:
15+
contents: read
16+
pages: write
17+
id-token: write
18+
19+
concurrency:
20+
group: "pages"
21+
cancel-in-progress: false
22+
23+
jobs:
24+
build:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
30+
- name: Setup Node.js
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: '20'
34+
cache: 'npm'
35+
cache-dependency-path: docs-site/package-lock.json
36+
37+
- name: Install dependencies
38+
run: |
39+
cd docs-site
40+
npm ci
41+
42+
- name: Sync documentation
43+
run: |
44+
cd docs-site
45+
node scripts/sync-docs.js
46+
47+
- name: Build Docusaurus site
48+
run: |
49+
cd docs-site
50+
npm run build
51+
52+
- name: Upload artifact
53+
uses: actions/upload-pages-artifact@v3
54+
with:
55+
path: docs-site/build
56+
57+
deploy:
58+
environment:
59+
name: github-pages
60+
url: ${{ steps.deployment.outputs.page_url }}
61+
runs-on: ubuntu-latest
62+
needs: build
63+
steps:
64+
- name: Deploy to GitHub Pages
65+
id: deployment
66+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)