Skip to content

Commit 17b3d16

Browse files
authored
CI - Add retries to javadocs build (#3489)
1 parent 22414f8 commit 17b3d16

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

.github/workflows/javadocs.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,23 @@ jobs:
7070
path: ~/.m2/repository/
7171
- name: Set Scala version
7272
run: ./build/scripts/change-scala-version.sh ${{ matrix.scala-version }}
73-
- name: Build with Maven
74-
run: mvn $MAVEN_COMPILE_ARGS $MAVEN_CLI_OPTS -am -pl ${{ matrix.projects.list }},geomesa-arrow/geomesa-arrow-jts
73+
- name: Compile
74+
id: compile
75+
continue-on-error: true
76+
run: |
77+
set -o pipefail
78+
mvn $MAVEN_COMPILE_ARGS $MAVEN_CLI_OPTS -am -pl ${{ matrix.projects.list }},geomesa-arrow/geomesa-arrow-jts | tee -a build.log
79+
- name: Compile (retry)
80+
if: steps.compile.outcome=='failure'
81+
run: |
82+
set -o pipefail
83+
# retry if the failure was due to transient download errors from maven central
84+
if grep -q -e 'Could not transfer artifact' -e 'Failed to read artifact descriptor' build.log; then
85+
RESUME_FROM="$({ grep --text 'mvn <args> -rf ' build.log || test $? = 1; } | tail -n1 | sed 's/.*-rf/-rf/')"
86+
mvn $MAVEN_COMPILE_ARGS $MAVEN_CLI_OPTS -am -pl ${{ matrix.projects.list }},geomesa-arrow/geomesa-arrow-jts $RESUME_FROM | tee -a build.log
87+
else
88+
exit 1
89+
fi
7590
- name: Build scaladocs
7691
run: mvn $MAVEN_SCALADOC_ARGS $MAVEN_CLI_OPTS -pl ${{ matrix.projects.list }}
7792
- name: Build javadocs

0 commit comments

Comments
 (0)