✨ Introduce index.ts for validators to streamline imports; update tes… #24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
test: | |
name: Test with Bun | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Bun | |
uses: oven-sh/setup-bun@v2 | |
with: | |
bun-version: latest | |
- name: Install dependencies | |
run: bun install --frozen-lockfile | |
- name: Run tests | |
run: bun test | |
- name: Type check | |
run: bun run tsc --noEmit | |
- name: Build package | |
run: bun run build | |
- name: Check build artifacts | |
run: | | |
if [ ! -d "dist" ]; then | |
echo "Build failed: dist directory not found" | |
exit 1 | |
fi | |
if [ ! -f "dist/index.js" ]; then | |
echo "Build failed: dist/index.js not found" | |
exit 1 | |
fi | |
if [ ! -f "dist/index.d.ts" ]; then | |
echo "Build failed: dist/index.d.ts not found" | |
exit 1 | |
fi | |
echo "Build artifacts verified successfully" | |
- name: Test package installation | |
run: | | |
# Pack the package to test it can be installed | |
bun pm pack | |
echo "Package packed successfully" | |
# Test Node.js compatibility without npm caching issues | |
test-node-compat: | |
name: Test Node.js Compatibility | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [22, 24] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
# Remove cache to avoid bun.lock vs package-lock.json conflicts | |
- name: Create package-lock.json for npm | |
run: | | |
# Create a temporary package-lock for npm compatibility test | |
npm install --package-lock-only | |
- name: Install dependencies with npm | |
run: npm ci | |
- name: Run tests with npm | |
run: npm test | |
- name: Type check with npm | |
run: npx tsc --noEmit | |
- name: Build package with npm | |
run: npm run build |