|
1 | | -name: Validate |
| 1 | +name: CI |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | pull_request: |
5 | | - branches: [dev, main] |
| 5 | + branches: [ dev, main ] |
| 6 | + push: |
| 7 | + branches: [ dev, main ] |
| 8 | + workflow_call: |
| 9 | + workflow_dispatch: |
| 10 | + |
| 11 | +concurrency: |
| 12 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 13 | + cancel-in-progress: true |
6 | 14 |
|
7 | 15 | jobs: |
8 | 16 | validate: |
9 | | - name: Validate Changes |
| 17 | + name: Lint Test Validate |
10 | 18 | runs-on: ubuntu-latest |
11 | | - |
| 19 | + permissions: |
| 20 | + contents: read |
| 21 | + |
12 | 22 | steps: |
13 | 23 | - name: Checkout code |
14 | 24 | uses: actions/checkout@v6 |
15 | | - |
| 25 | + |
| 26 | + - name: Detect secrets |
| 27 | + uses: gitleaks/gitleaks-action@v2.3.9 |
| 28 | + env: |
| 29 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 30 | + |
16 | 31 | - name: Setup Bun |
17 | 32 | uses: oven-sh/setup-bun@v2 |
18 | 33 | with: |
19 | 34 | bun-version: 1.3.13 |
20 | | - |
| 35 | + |
21 | 36 | - name: Setup Node.js |
22 | 37 | uses: actions/setup-node@v6 |
23 | 38 | with: |
24 | | - node-version: '22' |
25 | | - |
| 39 | + node-version: "22" |
| 40 | + |
| 41 | + - name: Cache Bun dependencies |
| 42 | + uses: actions/cache@v4 |
| 43 | + with: |
| 44 | + path: ~/.bun/install/cache |
| 45 | + key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }} |
| 46 | + restore-keys: | |
| 47 | + ${{ runner.os }}-bun- |
| 48 | +
|
26 | 49 | - name: Install dependencies |
27 | 50 | run: bun install --frozen-lockfile |
28 | | - |
| 51 | + |
| 52 | + - name: Lint |
| 53 | + run: biome check . --reporter=github |
| 54 | + |
29 | 55 | - name: Type checking |
30 | 56 | run: bun run type-check |
31 | | - |
| 57 | + |
32 | 58 | - name: Run tests |
33 | 59 | run: bun run test |
34 | | - |
| 60 | + |
35 | 61 | - name: Generate coverage |
36 | 62 | run: bun run test:coverage |
37 | | - continue-on-error: true |
38 | | - |
| 63 | + |
39 | 64 | - name: Build TypeScript |
40 | 65 | run: bun run build |
41 | | - |
| 66 | + |
42 | 67 | - name: Test Docker build (no push) |
43 | 68 | run: | |
44 | 69 | echo "Testing Docker build..." |
45 | 70 | docker build -t test-build . |
46 | 71 | echo "Build successful, cleaning up..." |
47 | 72 | docker image rm test-build |
48 | | - echo "✅ Docker build test completed" |
| 73 | + echo "Docker build test completed" |
0 commit comments