Skip to content

Commit fba3f20

Browse files
committed
fix test ci/cd
1 parent d361a0b commit fba3f20

File tree

1 file changed

+17
-42
lines changed

1 file changed

+17
-42
lines changed

.github/workflows/test.yml

Lines changed: 17 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,19 @@ jobs:
4141
with:
4242
bun-version: latest
4343

44-
- name: 📦 Install Dependencies
44+
- name: 📦 Install Root Dependencies
4545
run: bun install --frozen-lockfile
4646

47+
- name: 🔨 Build Package
48+
run: bun run build
49+
4750
- name: 📦 Install Example Dependencies
4851
working-directory: ./example
4952
run: bun install --frozen-lockfile
5053

5154
- name: 🎨 Check Code Formatting
5255
run: bun run format --check
5356

54-
- name: 🔨 Build Package
55-
run: bun run build
56-
5757
# Job 2: Unit Tests
5858
test:
5959
name: 🧪 Unit Tests
@@ -75,12 +75,16 @@ jobs:
7575
with:
7676
bun-version: ${{ matrix.bun-version }}
7777

78-
- name: 📦 Install Dependencies
78+
- name: 📦 Install Root Dependencies
7979
run: bun install --frozen-lockfile
8080

8181
- name: 🔨 Build Package
8282
run: bun run build
8383

84+
- name: 📦 Install Example Dependencies
85+
working-directory: ./example
86+
run: bun install --frozen-lockfile
87+
8488
- name: 🧪 Run Unit Tests
8589
run: bun test:unit
8690

@@ -112,12 +116,16 @@ jobs:
112116
with:
113117
bun-version: latest
114118

115-
- name: 📦 Install Dependencies
119+
- name: 📦 Install Root Dependencies
116120
run: bun install --frozen-lockfile
117121

118122
- name: 🔨 Build Package
119123
run: bun run build
120124

125+
- name: 📦 Install Example Dependencies
126+
working-directory: ./example
127+
run: bun install --frozen-lockfile
128+
121129
- name: 🎯 Run E2E Tests
122130
run: bun test:e2e
123131

@@ -200,44 +208,17 @@ jobs:
200208
- name: 📦 Test Package Installation
201209
run: |
202210
echo "Testing package installation..."
203-
bun pack
211+
npm pack
204212
mkdir test-install && cd test-install
205213
bun init -y
206214
bun add ../elysia-http-exception-*.tgz
207215
echo "✅ Package installation test passed"
208216
209-
# Job 6: Security Audit
210-
security:
211-
name: 🛡️ Security Audit
212-
runs-on: ubuntu-latest
213-
if: github.event.pull_request.draft == false
214-
215-
steps:
216-
- name: 📥 Checkout Repository
217-
uses: actions/checkout@v4
218-
219-
- name: 🟢 Setup Bun
220-
uses: oven-sh/setup-bun@v1
221-
with:
222-
bun-version: latest
223-
224-
- name: 📦 Install Dependencies
225-
run: bun install --frozen-lockfile
226-
227-
- name: 🛡️ Run Security Audit
228-
run: |
229-
# Check for known vulnerabilities
230-
if command -v npm &> /dev/null; then
231-
npm audit --audit-level=high
232-
else
233-
echo "⚠️ npm not available, skipping audit"
234-
fi
235-
236-
# Job 7: Results Summary
217+
# Job 6: Results Summary
237218
results:
238219
name: 📋 Test Results Summary
239220
runs-on: ubuntu-latest
240-
needs: [quality, test, e2e, example, build, security]
221+
needs: [quality, test, e2e, example, build]
241222
if: always() && github.event.pull_request.draft == false
242223

243224
steps:
@@ -276,12 +257,6 @@ jobs:
276257
echo "❌ **Build**: Failed" >> $GITHUB_STEP_SUMMARY
277258
fi
278259
279-
if [[ "${{ needs.security.result }}" == "success" ]]; then
280-
echo "✅ **Security**: Passed" >> $GITHUB_STEP_SUMMARY
281-
else
282-
echo "❌ **Security**: Failed" >> $GITHUB_STEP_SUMMARY
283-
fi
284-
285260
echo "" >> $GITHUB_STEP_SUMMARY
286261
echo "📊 **Overall Status**: ${{ (needs.quality.result == 'success' && needs.test.result == 'success' && needs.e2e.result == 'success' && needs.example.result == 'success' && needs.build.result == 'success') && '✅ All Checks Passed' || '❌ Some Checks Failed' }}" >> $GITHUB_STEP_SUMMARY
287262

0 commit comments

Comments
 (0)