|
7 | 7 | workflow_dispatch: |
8 | 8 |
|
9 | 9 | jobs: |
10 | | - # Builds the library and persists it as an artifact. |
11 | | - # Later jobs can then reuse that build artifact, skipping |
12 | | - # the build step. |
13 | | - build: |
| 10 | + build-18: |
| 11 | + name: build (18) |
14 | 12 | runs-on: macos-latest |
15 | 13 | steps: |
16 | 14 | - name: Checkout |
17 | 15 | uses: actions/checkout@v4 |
18 | 16 |
|
| 17 | + - name: Set up pnpm |
| 18 | + uses: pnpm/action-setup@v4 |
| 19 | + with: |
| 20 | + version: 9.14.0 |
| 21 | + |
19 | 22 | - name: Set up Node.js |
20 | 23 | uses: actions/setup-node@v4 |
21 | 24 | with: |
22 | 25 | node-version: 22 |
| 26 | + cache: 'pnpm' |
| 27 | + |
| 28 | + - name: Install dependencies |
| 29 | + run: pnpm install |
| 30 | + |
| 31 | + - name: Lint |
| 32 | + run: pnpm lint |
| 33 | + |
| 34 | + - name: Build |
| 35 | + run: pnpm build |
| 36 | + |
| 37 | + - name: Cache build output |
| 38 | + uses: actions/cache@v4 |
| 39 | + with: |
| 40 | + path: ./lib |
| 41 | + key: ${{ runner.os }}-node-18-build-${{ github.sha }} |
| 42 | + restore-keys: | |
| 43 | + ${{ runner.os }}-build-18 |
| 44 | +
|
| 45 | + build-20: |
| 46 | + name: build (20) |
| 47 | + runs-on: macos-latest |
| 48 | + steps: |
| 49 | + - name: Checkout |
| 50 | + uses: actions/checkout@v4 |
23 | 51 |
|
24 | | - - uses: pnpm/action-setup@v4 |
| 52 | + - name: Set up pnpm |
| 53 | + uses: pnpm/action-setup@v4 |
25 | 54 | with: |
26 | | - version: 8.15.6 |
| 55 | + version: 9.14.0 |
| 56 | + |
| 57 | + - name: Set up Node.js |
| 58 | + uses: actions/setup-node@v4 |
| 59 | + with: |
| 60 | + node-version: 20 |
| 61 | + cache: 'pnpm' |
27 | 62 |
|
28 | 63 | - name: Install dependencies |
29 | 64 | run: pnpm install |
30 | 65 |
|
31 | | - - name: Install Playwright browsers |
32 | | - run: pnpm exec playwright install |
33 | | - |
34 | 66 | - name: Lint |
35 | 67 | run: pnpm lint |
36 | 68 |
|
| 69 | + - name: Build |
| 70 | + run: pnpm build |
| 71 | + |
| 72 | + - name: Cache build output |
| 73 | + uses: actions/cache@v4 |
| 74 | + with: |
| 75 | + path: ./lib |
| 76 | + key: ${{ runner.os }}-node-20-build-${{ github.sha }} |
| 77 | + restore-keys: | |
| 78 | + ${{ runner.os }}-build-20 |
| 79 | +
|
| 80 | + test-unit-18: |
| 81 | + name: test (unit) (18) |
| 82 | + needs: build-18 |
| 83 | + runs-on: macos-latest |
| 84 | + steps: |
| 85 | + - name: Checkout |
| 86 | + uses: actions/checkout@v4 |
| 87 | + |
| 88 | + - name: Set up pnpm |
| 89 | + uses: pnpm/action-setup@v4 |
| 90 | + with: |
| 91 | + version: 9.14.0 |
| 92 | + |
| 93 | + - name: Set up Node.js |
| 94 | + uses: actions/setup-node@v4 |
| 95 | + with: |
| 96 | + node-version: 18 |
| 97 | + cache: 'pnpm' |
| 98 | + |
| 99 | + - name: Restore build cache |
| 100 | + uses: actions/cache@v4 |
| 101 | + with: |
| 102 | + path: ./lib |
| 103 | + key: ${{ runner.os }}-node-18-build-${{ github.sha }} |
| 104 | + restore-keys: | |
| 105 | + ${{ runner.os }}-node-18-build- |
| 106 | +
|
| 107 | + - name: Install dependencies |
| 108 | + run: pnpm install |
| 109 | + |
| 110 | + - name: Install Playwright browsers |
| 111 | + run: pnpm exec playwright install |
| 112 | + |
37 | 113 | - name: Unit tests |
38 | 114 | run: pnpm test:unit |
39 | 115 |
|
40 | | - - name: Build |
41 | | - run: pnpm build |
| 116 | + test-node-18: |
| 117 | + name: test (node.js) (18) |
| 118 | + needs: build-18 |
| 119 | + runs-on: macos-latest |
| 120 | + steps: |
| 121 | + - name: Checkout |
| 122 | + uses: actions/checkout@v4 |
| 123 | + |
| 124 | + - name: Set up pnpm |
| 125 | + uses: pnpm/action-setup@v4 |
| 126 | + with: |
| 127 | + version: 9.14.0 |
| 128 | + |
| 129 | + - name: Set up Node.js |
| 130 | + uses: actions/setup-node@v4 |
| 131 | + with: |
| 132 | + node-version: 18 |
| 133 | + cache: 'pnpm' |
| 134 | + |
| 135 | + - name: Restore build cache |
| 136 | + uses: actions/cache@v4 |
| 137 | + with: |
| 138 | + path: ./lib |
| 139 | + key: ${{ runner.os }}-node-18-build-${{ github.sha }} |
| 140 | + restore-keys: | |
| 141 | + ${{ runner.os }}-node-18-build- |
| 142 | +
|
| 143 | + - name: Install dependencies |
| 144 | + run: pnpm install |
42 | 145 |
|
43 | 146 | - name: Node.js tests |
44 | 147 | run: pnpm test:node |
45 | 148 |
|
| 149 | + test-node-20: |
| 150 | + name: test (node.js) (20) |
| 151 | + needs: build-20 |
| 152 | + runs-on: macos-latest |
| 153 | + steps: |
| 154 | + - name: Checkout |
| 155 | + uses: actions/checkout@v4 |
| 156 | + |
| 157 | + - name: Set up pnpm |
| 158 | + uses: pnpm/action-setup@v4 |
| 159 | + with: |
| 160 | + version: 9.14.0 |
| 161 | + |
| 162 | + - name: Set up Node.js |
| 163 | + uses: actions/setup-node@v4 |
| 164 | + with: |
| 165 | + node-version: 20 |
| 166 | + cache: 'pnpm' |
| 167 | + |
| 168 | + - name: Restore build cache |
| 169 | + uses: actions/cache@v4 |
| 170 | + with: |
| 171 | + path: ./lib |
| 172 | + key: ${{ runner.os }}-node-20-build-${{ github.sha }} |
| 173 | + restore-keys: | |
| 174 | + ${{ runner.os }}-node-20-build- |
| 175 | +
|
| 176 | + - name: Install dependencies |
| 177 | + run: pnpm install |
| 178 | + |
| 179 | + - name: Node.js tests |
| 180 | + run: pnpm test:node |
| 181 | + |
| 182 | + test-e2e: |
| 183 | + name: test (e2e) (18) |
| 184 | + needs: build-18 |
| 185 | + runs-on: macos-latest |
| 186 | + steps: |
| 187 | + - name: Checkout |
| 188 | + uses: actions/checkout@v4 |
| 189 | + |
| 190 | + - name: Set up pnpm |
| 191 | + uses: pnpm/action-setup@v4 |
| 192 | + with: |
| 193 | + version: 9.14.0 |
| 194 | + |
| 195 | + - name: Set up Node.js |
| 196 | + uses: actions/setup-node@v4 |
| 197 | + with: |
| 198 | + node-version: 18 |
| 199 | + cache: 'pnpm' |
| 200 | + |
| 201 | + - name: Install dependencies |
| 202 | + run: pnpm install |
| 203 | + |
| 204 | + - name: E2E tests |
| 205 | + run: pnpm test:e2e |
| 206 | + |
| 207 | + test-browser: |
| 208 | + name: test (browser) |
| 209 | + needs: build-18 |
| 210 | + runs-on: macos-latest |
| 211 | + steps: |
| 212 | + - name: Checkout |
| 213 | + uses: actions/checkout@v4 |
| 214 | + |
| 215 | + - name: Set up pnpm |
| 216 | + uses: pnpm/action-setup@v4 |
| 217 | + with: |
| 218 | + version: 9.14.0 |
| 219 | + |
| 220 | + - name: Set up Node.js |
| 221 | + uses: actions/setup-node@v4 |
| 222 | + with: |
| 223 | + node-version: 18 |
| 224 | + cache: 'pnpm' |
| 225 | + |
| 226 | + - name: Restore build cache |
| 227 | + uses: actions/cache@v4 |
| 228 | + with: |
| 229 | + path: ./lib |
| 230 | + key: ${{ runner.os }}-node-18-build-${{ github.sha }} |
| 231 | + restore-keys: | |
| 232 | + ${{ runner.os }}-node-18-build- |
| 233 | +
|
| 234 | + - name: Install dependencies |
| 235 | + run: pnpm install |
| 236 | + |
| 237 | + - name: Playwright install |
| 238 | + run: pnpm exec playwright install --with-deps chromium |
| 239 | + |
46 | 240 | - name: Browser tests |
47 | 241 | run: pnpm test:browser |
48 | 242 |
|
49 | | - - name: Native tests |
50 | | - run: pnpm test:native |
51 | | - |
52 | 243 | - name: Upload test artifacts |
53 | 244 | if: always() |
54 | | - uses: actions/upload-artifact@v3 |
| 245 | + uses: actions/upload-artifact@v4 |
55 | 246 | with: |
56 | 247 | name: playwright-report |
57 | 248 | path: test/browser/test-results |
| 249 | + |
| 250 | + test-native: |
| 251 | + name: test (react-native) |
| 252 | + needs: build-18 |
| 253 | + runs-on: macos-latest |
| 254 | + steps: |
| 255 | + - name: Checkout |
| 256 | + uses: actions/checkout@v4 |
| 257 | + |
| 258 | + - name: Set up pnpm |
| 259 | + uses: pnpm/action-setup@v4 |
| 260 | + with: |
| 261 | + version: 9.14.0 |
| 262 | + |
| 263 | + - name: Set up Node.js |
| 264 | + uses: actions/setup-node@v4 |
| 265 | + with: |
| 266 | + node-version: 18 |
| 267 | + cache: 'pnpm' |
| 268 | + |
| 269 | + - name: Restore build cache |
| 270 | + uses: actions/cache@v4 |
| 271 | + with: |
| 272 | + path: ./lib |
| 273 | + key: ${{ runner.os }}-node-18-build-${{ github.sha }} |
| 274 | + restore-keys: | |
| 275 | + ${{ runner.os }}-node-18-build- |
| 276 | +
|
| 277 | + - name: Install dependencies |
| 278 | + run: pnpm install |
| 279 | + |
| 280 | + - name: React Native tests |
| 281 | + run: pnpm test:native |
0 commit comments