@@ -22,31 +22,75 @@ jobs:
2222
2323 - name : Install static analysis tools
2424 run : |
25- dnf update -y
26- dnf install -y epel-release
27- dnf install -y gcc make bison flex automake autoconf diffutils gettext java-21-openjdk-devel git-clang-format cppcheck
25+ # Add retry logic for package installation to handle transient network issues
26+ for i in {1..3}; do
27+ if dnf update -y && dnf install -y epel-release && dnf install -y gcc make bison flex automake autoconf diffutils gettext java-21-openjdk-devel git-clang-format cppcheck; then
28+ break
29+ elif [ $i -eq 3 ]; then
30+ echo "Package installation failed after 3 attempts"
31+ exit 1
32+ else
33+ echo "Package installation attempt $i failed, retrying..."
34+ sleep 30
35+ dnf clean all
36+ fi
37+ done
2838
2939 - name : Install opensource COBOL 4J
3040 run : |
31- ./configure --prefix=/usr/
32- make
33- make install
41+ # Add retries for build and install to handle transient failures
42+ for i in {1..2}; do
43+ if ./configure --prefix=/usr/ && make && make install; then
44+ break
45+ elif [ $i -eq 2 ]; then
46+ echo "Build and install failed after 2 attempts"
47+ exit 1
48+ else
49+ echo "Build and install attempt $i failed, retrying..."
50+ make clean || true
51+ sleep 10
52+ fi
53+ done
3454
3555 - name : Check format with google-java-format and clang-format
3656 run : |
37- ./check-format
57+ # Add timeout and make format checking more robust
58+ timeout 300 ./check-format
3859
3960 - name : Run SpotBugs
4061 working-directory : libcobj
4162 run : |
42- ./gradlew spotbugsMain
63+ # Use --no-daemon to avoid daemon conflicts in CI and add retries for reliability
64+ for i in {1..3}; do
65+ if ./gradlew spotbugsMain --no-daemon --console=plain; then
66+ break
67+ elif [ $i -eq 3 ]; then
68+ echo "SpotBugs failed after 3 attempts"
69+ exit 1
70+ else
71+ echo "SpotBugs attempt $i failed, retrying..."
72+ sleep 10
73+ fi
74+ done
4375
4476 - name : Run PMD
4577 working-directory : libcobj
4678 run : |
47- ./gradlew pmdMain
79+ # Use --no-daemon to avoid daemon conflicts in CI and add retries for reliability
80+ for i in {1..3}; do
81+ if ./gradlew pmdMain --no-daemon --console=plain; then
82+ break
83+ elif [ $i -eq 3 ]; then
84+ echo "PMD failed after 3 attempts"
85+ exit 1
86+ else
87+ echo "PMD attempt $i failed, retrying..."
88+ sleep 10
89+ fi
90+ done
4891
4992 - name : Run cppcheck
5093 working-directory : cobj
5194 run : |
52- ./cpp-check
95+ # Add timeout to prevent hanging
96+ timeout 300 ./cpp-check
0 commit comments