CI #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: | |
| pull_request: | |
| branches: ["main"] | |
| release: | |
| types: ["published"] | |
| workflow_dispatch: {} | |
| jobs: | |
| test: | |
| name: Run tests | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v3 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Run tests (with coverage) | |
| run: bun run test | |
| - name: Upload coverage (if generated) | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: coverage | |
| bench: | |
| name: Run benchmarks | |
| if: github.event_name == 'release' || github.event_name == 'workflow_dispatch' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v3 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Run benchmarks | |
| run: | | |
| bun run bench | tee bench-output.txt | |
| - name: Upload bench output | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: bench-output | |
| path: bench-output.txt | |
| memory-check: | |
| name: Run memory check | |
| if: github.event_name == 'release' || github.event_name == 'workflow_dispatch' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v3 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Run memory check | |
| run: | | |
| bun run memory-check | tee memory-check-output.txt | |
| - name: Upload memory check output | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: memory-check-output | |
| path: memory-check-output.txt |