feat(ci): add GitHub Actions CI workflow with test, typecheck, and bu… #1
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: [master] | |
| pull_request: | |
| branches: [master] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install | |
| env: | |
| BUN_INSTALL_ALLOW_SCRIPTS: "@ast-grep/napi" | |
| - name: Run tests | |
| run: bun test | |
| typecheck: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install | |
| env: | |
| BUN_INSTALL_ALLOW_SCRIPTS: "@ast-grep/napi" | |
| - name: Type check | |
| run: bun run typecheck | |
| build: | |
| runs-on: ubuntu-latest | |
| needs: [test, typecheck] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install | |
| env: | |
| BUN_INSTALL_ALLOW_SCRIPTS: "@ast-grep/napi" | |
| - name: Build | |
| run: bun run build | |
| - name: Verify build output | |
| run: | | |
| test -f dist/index.js || (echo "ERROR: dist/index.js not found!" && exit 1) | |
| test -f dist/index.d.ts || (echo "ERROR: dist/index.d.ts not found!" && exit 1) |