Skip to content

Commit 3977f1b

Browse files
committed
ci: 增强依赖安装重试
1 parent 679b260 commit 3977f1b

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,17 @@ jobs:
4646
git clone --depth 1 --branch "${EASY4J_BRANCH}" \
4747
"https://github.com/easy-4-java/${dependency}.git" \
4848
"${dependency_root}/${dependency}"
49-
mvn -B --no-transfer-progress \
50-
-f "${dependency_root}/${dependency}/pom.xml" \
51-
-DskipTests -Djacoco.skip=true -Dgpg.skip=true install
49+
for attempt in 1 2 3; do
50+
if mvn -B --no-transfer-progress \
51+
-f "${dependency_root}/${dependency}/pom.xml" \
52+
-DskipTests -Djacoco.skip=true -Dgpg.skip=true install; then
53+
break
54+
fi
55+
if [[ "${attempt}" -eq 3 ]]; then
56+
exit 1
57+
fi
58+
sleep "$((attempt * 10))"
59+
done
5260
done
5361
5462
- name: Build and verify with JaCoCo coverage gate

0 commit comments

Comments
 (0)