|
9 | 9 | - main |
10 | 10 |
|
11 | 11 | jobs: |
12 | | - test: |
| 12 | + quality: |
13 | 13 | runs-on: ubuntu-latest |
14 | 14 | steps: |
15 | | - # Checkout the repository |
16 | | - - name: Checkout code |
| 15 | + - name: Checkout |
17 | 16 | uses: actions/checkout@v4 |
18 | 17 |
|
19 | | - - name: Install pnpm |
20 | | - uses: pnpm/action-setup@v4 |
| 18 | + - name: Setup Node.js |
| 19 | + uses: actions/setup-node@v4 |
21 | 20 | with: |
22 | | - version: 9 |
23 | | - run_install: false # We'll do this later |
| 21 | + node-version: "20" |
| 22 | + |
| 23 | + - name: Setup pnpm |
| 24 | + uses: pnpm/action-setup@v2 |
| 25 | + with: |
| 26 | + version: 8.15.4 |
| 27 | + |
| 28 | + - name: Install dependencies |
| 29 | + run: pnpm install |
| 30 | + |
| 31 | + - name: Run format check |
| 32 | + run: pnpm format |
| 33 | + |
| 34 | + test: |
| 35 | + runs-on: ubuntu-latest |
| 36 | + needs: quality |
| 37 | + steps: |
| 38 | + - name: Checkout code |
| 39 | + uses: actions/checkout@v4 |
24 | 40 |
|
25 | | - # Setup Node.js with pnpm |
26 | 41 | - name: Setup Node.js |
27 | 42 | uses: actions/setup-node@v4 |
28 | 43 | with: |
29 | | - node-version: 20 |
30 | | - cache: 'pnpm' |
| 44 | + node-version: "20" |
| 45 | + registry-url: "https://registry.npmjs.org" |
31 | 46 |
|
32 | | - # Install all dependencies at the root |
33 | | - - name: Install dependencies (pnpm) |
34 | | - run: pnpm install |
35 | | - - name: Check formatting |
36 | | - run: pnpm format:ci |
37 | | - - name: Start Firebase Emulator Suite |
38 | | - uses: invertase/firebase-emulator-action@v1.0.1 |
| 47 | + - name: Setup pnpm |
| 48 | + uses: pnpm/action-setup@v2 |
39 | 49 | with: |
40 | | - emulators: 'auth,firestore,functions,storage,database,dataconnect' |
| 50 | + version: 8.15.4 |
41 | 51 |
|
42 | | - - name: Verify Running Emulators |
43 | | - run: | |
44 | | - curl --silent http://localhost:4400/emulators | jq 'keys[]' |
| 52 | + - name: Install dependencies |
| 53 | + run: pnpm install |
45 | 54 |
|
| 55 | + - name: Install Firebase CLI |
| 56 | + uses: nick-invision/retry@v3 |
| 57 | + with: |
| 58 | + timeout_minutes: 10 |
| 59 | + retry_wait_seconds: 60 |
| 60 | + max_attempts: 3 |
| 61 | + command: npm i -g firebase-tools@14 |
46 | 62 |
|
47 | 63 | # Determine which packages have changed |
48 | 64 | - name: Determine changed packages |
|
54 | 70 | - 'packages/react/**' |
55 | 71 | angular: |
56 | 72 | - 'packages/angular/**' |
57 | | - |
58 | | - # Run tests for the React package if it has changed |
59 | | - - name: Run React Tests |
60 | | - if: steps.changes.outputs.react == 'true' |
61 | | - run: cd packages/react && pnpm vitest --dom |
62 | | - - name: Run Angular Tests |
63 | | - if: steps.changes.outputs.angular == 'true' |
64 | | - run: cd packages/angular && pnpm vitest --dom |
65 | 73 |
|
66 | | - # Run tests for the Vue package if it has changed |
67 | | - # - name: Run Vue Tests |
68 | | - # if: steps.changes.outputs.vue == 'true' |
69 | | - # run: pnpm --filter vue test |
| 74 | + # Run tests with emulator for changed packages |
| 75 | + - name: Run tests with emulator |
| 76 | + run: pnpm test:emulator |
0 commit comments