fix(ci): add retry logic to bun install steps for transient network failures
Swadhin Biswas committed 5 months ago
c2c1cb3
1 parent 51a74af
commit c2c1cb3
1 file changed
+48 -8
Showing 1 changed file+48-8
▼.github/workflows/ci.yml
+48-8
| @@ -26,7 +26,12 @@ jobs: | ||
26 | 26 | bun-version: latest |
27 | 27 | |
28 | 28 | - name: Install dependencies |
29 | - run: bun install --frozen-lockfile | |
29 | + run: | | |
30 | + for i in 1 2 3; do | |
31 | + bun install --frozen-lockfile && break | |
32 | + echo "bun install attempt $i failed, retrying in 10s..." | |
33 | + sleep 10 | |
34 | + done | |
30 | 35 | |
31 | 36 | - name: Run ESLint |
32 | 37 | run: bun run lint |
| @@ -46,7 +51,12 @@ jobs: | ||
46 | 51 | bun-version: latest |
47 | 52 | |
48 | 53 | - name: Install dependencies |
49 | - run: bun install --frozen-lockfile | |
54 | + run: | | |
55 | + for i in 1 2 3; do | |
56 | + bun install --frozen-lockfile && break | |
57 | + echo "bun install attempt $i failed, retrying in 10s..." | |
58 | + sleep 10 | |
59 | + done | |
50 | 60 | |
51 | 61 | - name: Check docs parity |
52 | 62 | run: bun run docs:parity |
| @@ -66,7 +76,12 @@ jobs: | ||
66 | 76 | bun-version: latest |
67 | 77 | |
68 | 78 | - name: Install dependencies |
69 | - run: bun install --frozen-lockfile | |
79 | + run: | | |
80 | + for i in 1 2 3; do | |
81 | + bun install --frozen-lockfile && break | |
82 | + echo "bun install attempt $i failed, retrying in 10s..." | |
83 | + sleep 10 | |
84 | + done | |
70 | 85 | |
71 | 86 | - name: Dependency audit (high+) |
72 | 87 | run: bun pm audit --level=high || true |
| @@ -102,7 +117,12 @@ jobs: | ||
102 | 117 | bun-version: latest |
103 | 118 | |
104 | 119 | - name: Install dependencies |
105 | - run: bun install --frozen-lockfile | |
120 | + run: | | |
121 | + for i in 1 2 3; do | |
122 | + bun install --frozen-lockfile && break | |
123 | + echo "bun install attempt $i failed, retrying in 10s..." | |
124 | + sleep 10 | |
125 | + done | |
106 | 126 | |
107 | 127 | - name: Run tests with coverage |
108 | 128 | run: bun run test:coverage |
| @@ -156,7 +176,12 @@ jobs: | ||
156 | 176 | bun-version: latest |
157 | 177 | |
158 | 178 | - name: Install dependencies |
159 | - run: bun install --frozen-lockfile | |
179 | + run: | | |
180 | + for i in 1 2 3; do | |
181 | + bun install --frozen-lockfile && break | |
182 | + echo "bun install attempt $i failed, retrying in 10s..." | |
183 | + sleep 10 | |
184 | + done | |
160 | 185 | |
161 | 186 | - name: Install Playwright browsers |
162 | 187 | run: bunx playwright install --with-deps chromium |
| @@ -257,7 +282,12 @@ jobs: | ||
257 | 282 | with: |
258 | 283 | bun-version: latest |
259 | 284 | - name: Install dependencies |
260 | - run: bun install --frozen-lockfile | |
285 | + run: | | |
286 | + for i in 1 2 3; do | |
287 | + bun install --frozen-lockfile && break | |
288 | + echo "bun install attempt $i failed, retrying in 10s..." | |
289 | + sleep 10 | |
290 | + done | |
261 | 291 | - name: Build application |
262 | 292 | run: bun run build |
263 | 293 | env: |
| @@ -301,7 +331,12 @@ jobs: | ||
301 | 331 | bun-version: latest |
302 | 332 | |
303 | 333 | - name: Install dependencies |
304 | - run: bun install --frozen-lockfile | |
334 | + run: | | |
335 | + for i in 1 2 3; do | |
336 | + bun install --frozen-lockfile && break | |
337 | + echo "bun install attempt $i failed, retrying in 10s..." | |
338 | + sleep 10 | |
339 | + done | |
305 | 340 | |
306 | 341 | - name: Build application |
307 | 342 | run: bun run build |
| @@ -377,7 +412,12 @@ jobs: | ||
377 | 412 | registry-url: "https://registry.npmjs.org" |
378 | 413 | |
379 | 414 | - name: Install dependencies |
380 | - run: bun install --frozen-lockfile | |
415 | + run: | | |
416 | + for i in 1 2 3; do | |
417 | + bun install --frozen-lockfile && break | |
418 | + echo "bun install attempt $i failed, retrying in 10s..." | |
419 | + sleep 10 | |
420 | + done | |
381 | 421 | working-directory: cli |
382 | 422 | |
383 | 423 | - name: Build CLI |
384 | 424 | |