ci: improve npm publish workflow with Bun cache #2
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: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| bun-version: [latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: ${{ matrix.bun-version }} | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Lint | |
| run: bun run lint:fix | |
| - name: Type check | |
| run: bun run type-check | |
| - name: Run tests | |
| run: bun test | |
| - name: Build | |
| run: bun run build | |
| - name: Check build output | |
| run: | | |
| 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 |