Skip to content

Commit fdd0cbb

Browse files
committed
fix ci timout
1 parent 9afe72a commit fdd0cbb

1 file changed

Lines changed: 44 additions & 6 deletions

File tree

.github/workflows/ci-pr-validation.yaml

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,25 @@ jobs:
9999
key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json') }}
100100
restore-keys: vcpkg-${{ runner.os }}-
101101

102+
- name: Restore vcpkg downloads cache
103+
uses: actions/cache@v4
104+
with:
105+
path: vcpkg/downloads
106+
key: vcpkg-downloads-${{ runner.os }}-${{ hashFiles('vcpkg.json') }}
107+
restore-keys: vcpkg-downloads-${{ runner.os }}-
108+
102109
- name: Build the project
103110
run: |
104-
cmake -B build -DINTEGRATE_VCPKG=ON -DBUILD_TESTS=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
105-
cmake --build build -j8
111+
for attempt in 1 2 3; do
112+
echo "Build attempt $attempt/3"
113+
if cmake -B build -DINTEGRATE_VCPKG=ON -DBUILD_TESTS=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON && cmake --build build -j8; then
114+
exit 0
115+
fi
116+
echo "Attempt $attempt failed (e.g. vcpkg download 502), retrying in 90s..."
117+
sleep 90
118+
done
119+
echo "All build attempts failed"
120+
exit 1
106121
107122
- name: Tidy check
108123
run: |
@@ -137,10 +152,25 @@ jobs:
137152
key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json') }}
138153
restore-keys: vcpkg-${{ runner.os }}-
139154

155+
- name: Restore vcpkg downloads cache
156+
uses: actions/cache@v4
157+
with:
158+
path: vcpkg/downloads
159+
key: vcpkg-downloads-${{ runner.os }}-${{ hashFiles('vcpkg.json') }}
160+
restore-keys: vcpkg-downloads-${{ runner.os }}-
161+
140162
- name: Build core libraries
141163
run: |
142-
cmake -B build -DINTEGRATE_VCPKG=ON -DBUILD_TESTS=OFF
143-
cmake --build build -j8
164+
for attempt in 1 2 3; do
165+
echo "Build attempt $attempt/3"
166+
if cmake -B build -DINTEGRATE_VCPKG=ON -DBUILD_TESTS=OFF && cmake --build build -j8; then
167+
exit 0
168+
fi
169+
echo "Attempt $attempt failed (e.g. vcpkg download 502), retrying in 90s..."
170+
sleep 90
171+
done
172+
echo "All build attempts failed"
173+
exit 1
144174
145175
- name: Check formatting
146176
run: |
@@ -164,8 +194,16 @@ jobs:
164194

165195
- name: Build with Boost.Asio
166196
run: |
167-
cmake -B build-boost-asio -DINTEGRATE_VCPKG=ON -DBUILD_TESTS=ON
168-
cmake --build build-boost-asio -j8
197+
for attempt in 1 2 3; do
198+
echo "Build Boost.Asio attempt $attempt/3"
199+
if cmake -B build-boost-asio -DINTEGRATE_VCPKG=ON -DBUILD_TESTS=ON && cmake --build build-boost-asio -j8; then
200+
exit 0
201+
fi
202+
echo "Attempt $attempt failed (e.g. vcpkg download 502), retrying in 90s..."
203+
sleep 90
204+
done
205+
echo "All build attempts failed"
206+
exit 1
169207
170208
- name: Build perf tools
171209
run: |

0 commit comments

Comments
 (0)