feat: show validation value even on clean PRs (#6) #26
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] | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| name: Lint | |
| 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 --frozen-lockfile | |
| - name: ESLint | |
| run: bun run lint | |
| typecheck: | |
| name: 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 --frozen-lockfile | |
| - name: TypeScript check | |
| run: bun run typecheck | |
| format: | |
| name: Format | |
| 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 --frozen-lockfile | |
| - name: Prettier check | |
| run: bun run format:check | |
| unit-tests: | |
| name: Unit Tests | |
| 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 --frozen-lockfile | |
| - name: Run unit tests | |
| run: bun test test/unit/ | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| needs: [lint, typecheck, format, unit-tests] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Build dist/ | |
| run: bun run build | |
| - name: Verify dist/index.js exists | |
| run: | | |
| if [ ! -f dist/index.js ]; then | |
| echo "::error::dist/index.js was not produced by the build" | |
| exit 1 | |
| fi | |
| - name: Verify bundle size < 10MB | |
| run: | | |
| SIZE=$(stat -c%s dist/index.js 2>/dev/null || stat -f%z dist/index.js) | |
| MAX=$((10 * 1024 * 1024)) | |
| echo "Bundle size: $SIZE bytes ($(( SIZE / 1024 )) KB)" | |
| if [ "$SIZE" -gt "$MAX" ]; then | |
| echo "::error::dist/index.js is $SIZE bytes, exceeding 10MB limit" | |
| exit 1 | |
| fi | |
| - name: Upload dist artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist/ | |
| retention-days: 7 |