Skip to content

Commit a15da55

Browse files
committed
feat: add ci
1 parent 22dc537 commit a15da55

File tree

2 files changed

+191
-0
lines changed

2 files changed

+191
-0
lines changed

.github/CODEOWNERS

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Global code owners
2+
# These owners will be requested for review when anyone opens a pull request.
3+
4+
# Main codebase
5+
* @modbender
6+
7+
# Workflow files require approval from maintainers
8+
/.github/ @modbender
9+
10+
# Documentation
11+
/docs/ @modbender
12+
README.md @modbender
13+
14+
# Configuration files
15+
package.json @modbender
16+
tsconfig.json @modbender
17+
eslint.config.mjs @modbender
18+
19+
# Core module files
20+
/src/ @modbender
21+
22+
# Test files
23+
/test/ @modbender

.github/workflows/ci.yml

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
name: Continuous Integration
2+
3+
permissions:
4+
checks: write
5+
contents: read
6+
pull-requests: write
7+
8+
on:
9+
push:
10+
branches: [main, develop]
11+
pull_request:
12+
branches: [main, develop]
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
lint:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v4
24+
25+
- name: Install pnpm
26+
uses: pnpm/action-setup@v4
27+
28+
- name: Setup Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: 'lts/*'
32+
cache: 'pnpm'
33+
34+
- name: Install dependencies
35+
run: pnpm install --frozen-lockfile
36+
37+
- name: Run linter
38+
run: pnpm lint
39+
40+
test:
41+
runs-on: ubuntu-latest
42+
needs: lint
43+
steps:
44+
- name: Checkout code
45+
uses: actions/checkout@v4
46+
47+
- name: Install pnpm
48+
uses: pnpm/action-setup@v4
49+
50+
- name: Setup Node.js
51+
uses: actions/setup-node@v4
52+
with:
53+
node-version: 'lts/*'
54+
cache: 'pnpm'
55+
56+
- name: Install dependencies
57+
run: pnpm install --frozen-lockfile
58+
59+
- name: Run prepare
60+
run: pnpm dev:prepare
61+
62+
- name: Cache build outputs
63+
uses: actions/cache@v4
64+
with:
65+
path: |
66+
.nuxt
67+
dist
68+
key: ${{ runner.os }}-build-${{ github.sha }}
69+
restore-keys: |
70+
${{ runner.os }}-build-
71+
72+
- name: Run tests
73+
run: pnpm test
74+
75+
- name: Run type checks
76+
run: pnpm test:types
77+
78+
build:
79+
runs-on: ubuntu-latest
80+
needs: lint
81+
steps:
82+
- name: Checkout code
83+
uses: actions/checkout@v4
84+
85+
- name: Install pnpm
86+
uses: pnpm/action-setup@v4
87+
88+
- name: Setup Node.js
89+
uses: actions/setup-node@v4
90+
with:
91+
node-version: 'lts/*'
92+
cache: 'pnpm'
93+
94+
- name: Install dependencies
95+
run: pnpm install --frozen-lockfile
96+
97+
- name: Run dev:prepare
98+
run: pnpm dev:prepare
99+
100+
- name: Run prepack (build module)
101+
run: pnpm prepack
102+
103+
- name: Build playground
104+
run: pnpm build
105+
106+
- name: Upload build artifacts
107+
uses: actions/upload-artifact@v4
108+
with:
109+
name: build-artifacts
110+
path: |
111+
dist/
112+
playground/.output/
113+
retention-days: 7
114+
115+
# Matrix testing across different Node.js versions
116+
test-matrix:
117+
runs-on: ubuntu-latest
118+
needs: lint
119+
strategy:
120+
matrix:
121+
node-version: [18, 20, 21]
122+
steps:
123+
- name: Checkout code
124+
uses: actions/checkout@v4
125+
126+
- name: Install pnpm
127+
uses: pnpm/action-setup@v4
128+
129+
- name: Setup Node.js ${{ matrix.node-version }}
130+
uses: actions/setup-node@v4
131+
with:
132+
node-version: ${{ matrix.node-version }}
133+
cache: 'pnpm'
134+
135+
- name: Install dependencies
136+
run: pnpm install --frozen-lockfile
137+
138+
- name: Run prepare
139+
run: pnpm dev:prepare
140+
141+
- name: Run tests
142+
run: pnpm test
143+
144+
# Summary job that will be used as a required status check
145+
ci-summary:
146+
runs-on: ubuntu-latest
147+
needs: [lint, test, build, test-matrix]
148+
if: always()
149+
steps:
150+
- name: Check all jobs status
151+
run: |
152+
if [[ "${{ needs.lint.result }}" != "success" ]]; then
153+
echo "❌ Lint job failed"
154+
exit 1
155+
fi
156+
if [[ "${{ needs.test.result }}" != "success" ]]; then
157+
echo "❌ Test job failed"
158+
exit 1
159+
fi
160+
if [[ "${{ needs.build.result }}" != "success" ]]; then
161+
echo "❌ Build job failed"
162+
exit 1
163+
fi
164+
if [[ "${{ needs.test-matrix.result }}" != "success" ]]; then
165+
echo "❌ Matrix test job failed"
166+
exit 1
167+
fi
168+
echo "✅ All CI jobs passed successfully!"

0 commit comments

Comments
 (0)