|
1 | 1 | name: CI |
2 | 2 |
|
3 | 3 | on: |
4 | | - push: |
5 | | - branches: [main] |
6 | 4 | pull_request: |
7 | 5 | branches: [main] |
8 | 6 |
|
| 7 | +env: |
| 8 | + TZ: UTC |
| 9 | + BUN_VERSION: "1.3.9" |
| 10 | + |
9 | 11 | jobs: |
10 | 12 | quality: |
11 | | - name: Quality Checks |
| 13 | + name: Lint, Typecheck & Unit Tests |
12 | 14 | runs-on: ubuntu-latest |
13 | 15 |
|
14 | 16 | steps: |
15 | | - - name: Checkout code |
16 | | - uses: actions/checkout@v4 |
| 17 | + - uses: actions/checkout@v4 |
17 | 18 |
|
18 | | - - name: Setup Bun |
19 | | - uses: oven-sh/setup-bun@v2 |
| 19 | + - uses: oven-sh/setup-bun@v2 |
20 | 20 | with: |
21 | | - bun-version: 1.3.9 |
| 21 | + bun-version: ${{ env.BUN_VERSION }} |
22 | 22 |
|
23 | | - - name: Cache dependencies |
24 | | - uses: actions/cache@v4 |
| 23 | + - uses: actions/cache@v4 |
25 | 24 | with: |
26 | 25 | path: | |
27 | 26 | ~/.bun/install/cache |
28 | 27 | node_modules |
29 | 28 | packages/*/node_modules |
30 | 29 | key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }} |
31 | | - restore-keys: | |
32 | | - ${{ runner.os }}-bun- |
| 30 | + restore-keys: ${{ runner.os }}-bun- |
| 31 | + |
| 32 | + - run: bun install |
33 | 33 |
|
34 | | - - name: Install dependencies |
35 | | - run: bun install |
| 34 | + - name: Lint |
| 35 | + run: bun run lint |
36 | 36 |
|
37 | | - - name: Run type checking |
| 37 | + - name: Format check |
| 38 | + run: bun run format:check |
| 39 | + |
| 40 | + - name: Typecheck |
38 | 41 | run: bun run typecheck |
39 | 42 |
|
40 | | - - name: Run type-level API tests |
| 43 | + - name: Type-level API tests |
41 | 44 | run: bun run test:types |
42 | 45 |
|
43 | | - - name: Run JavaScript tests |
44 | | - run: bun run test |
45 | | - |
46 | | - - name: Run JavaScript tests with coverage |
| 46 | + - name: Unit tests with coverage |
47 | 47 | run: bun run test:coverage |
48 | 48 |
|
49 | | - - name: Run benchmark regression checks |
| 49 | + - name: Benchmark regression checks |
50 | 50 | run: bun run benchmark |
51 | 51 |
|
52 | | - - name: Setup CMake (for C++ tests) |
53 | | - run: | |
54 | | - cmake --version |
55 | | - gcc --version || clang --version || echo "C++ compiler available" |
56 | | -
|
57 | | - - name: Run C++ tests |
| 52 | + - name: C++ tests |
58 | 53 | run: bun run test:cpp |
59 | | - |
60 | | - - name: Build packages |
61 | | - run: bun run build |
62 | | - |
63 | | - - name: Verify build artifacts |
64 | | - run: | |
65 | | - # Check that lib directories were created |
66 | | - [ -d "packages/react-native-nitro-storage/lib" ] || exit 1 |
67 | | - # Check that TypeScript definitions exist |
68 | | - [ -f "packages/react-native-nitro-storage/lib/typescript/index.d.ts" ] || exit 1 |
69 | | - # Check that all build targets exist |
70 | | - [ -d "packages/react-native-nitro-storage/lib/commonjs" ] || exit 1 |
71 | | - [ -d "packages/react-native-nitro-storage/lib/module" ] || exit 1 |
72 | | - echo "✅ Build artifacts verified" |
73 | | -
|
74 | | - - name: Test package packaging |
75 | | - run: | |
76 | | - cd packages/react-native-nitro-storage |
77 | | - bun run check:pack |
78 | | -
|
79 | | - build-example-android: |
80 | | - name: Android Example Build |
81 | | - runs-on: ubuntu-latest |
82 | | - needs: quality |
83 | | - |
84 | | - steps: |
85 | | - - name: Checkout code |
86 | | - uses: actions/checkout@v4 |
87 | | - |
88 | | - - name: Setup Bun |
89 | | - uses: oven-sh/setup-bun@v2 |
90 | | - with: |
91 | | - bun-version: 1.3.9 |
92 | | - |
93 | | - - name: Setup Java |
94 | | - uses: actions/setup-java@v4 |
95 | | - with: |
96 | | - distribution: temurin |
97 | | - java-version: "17" |
98 | | - |
99 | | - - name: Install dependencies |
100 | | - run: bun install |
101 | | - |
102 | | - - name: Expo prebuild (Android) |
103 | | - run: bun run example:prebuild:clean -- -- --platform android --non-interactive |
104 | | - env: |
105 | | - EXPO_NO_TELEMETRY: 1 |
106 | | - |
107 | | - - name: Gradle build check |
108 | | - working-directory: apps/example/android |
109 | | - run: ./gradlew assembleDebug --no-daemon -q |
110 | | - |
0 commit comments