Skip to content

Commit 4d24987

Browse files
committed
[ci] Retry to install Carthage
1 parent c8b8204 commit 4d24987

File tree

1 file changed

+32
-3
lines changed

1 file changed

+32
-3
lines changed

.circleci/config.yml

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,38 @@ jobs:
6767
- run:
6868
name: Install Carthage
6969
command: |
70-
sudo softwareupdate --install-rosetta --agree-to-license
71-
curl -OL "https://github.com/Carthage/Carthage/releases/download/0.39.1/Carthage.pkg"
72-
sudo installer -pkg Carthage.pkg -target /
70+
max_retries=3
71+
attempt=0
72+
while (( attempt < max_retries )); do
73+
((attempt++))
74+
sudo softwareupdate --install-rosetta --agree-to-license
75+
if [[ $? -eq 0 ]]; then
76+
attempt=max_retries
77+
echo "Rosetta installed"
78+
else
79+
echo "Rosetta installation failed on attempt $attempt"
80+
fi
81+
82+
sleep 1
83+
done
84+
85+
attempt=0
86+
while (( attempt < max_retries )); do
87+
((attempt++))
88+
rm -rf Carthage.pkg
89+
curl -OL "https://github.com/Carthage/Carthage/releases/download/0.39.1/Carthage.pkg"
90+
sudo installer -pkg Carthage.pkg -target /
91+
92+
if [[ $? -eq 0 ]]; then
93+
attempt=max_retries
94+
echo "Carthage installed"
95+
else
96+
echo "Carthage installation failed on attempt $attempt"
97+
fi
98+
99+
sleep 1
100+
done
101+
73102
- run:
74103
name: Test Integration via Carthage
75104
command: Tests/Integration/test_carthage.sh

0 commit comments

Comments
 (0)