Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: re-enable Windows target and allow 2 retries of maven build step on failure #1036

Merged
merged 1 commit into from
Jul 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 49 additions & 44 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ jobs:
#- ubuntu-latest # TODO builds are extremely slow for no apparent reason and job currently times out after 15 minutes
- macos-12 # Intel
- macos-14 # ARM
#- windows-latest # TODO currently too many random test failures
- windows-latest
runs-on: ${{ matrix.os }}
timeout-minutes: 15
timeout-minutes: 20

steps:
- name: "Show: GitHub context"
Expand Down Expand Up @@ -166,48 +166,53 @@ jobs:


- name: "Build with Maven 🔨"
run: |
set -eu

MAVEN_OPTS="${MAVEN_OPTS:-}"
if [[ "${{ runner.os }}" == "Windows" ]]; then
MAVEN_OPTS+=" -Djava.security.egd=file:/dev/urandom" # https://www.baeldung.com/java-security-egd#bd-testing-the-effect-of-javasecurityegd
else
MAVEN_OPTS+=" -Djava.security.egd=file:/dev/./urandom" # https://stackoverflow.com/questions/58991966/what-java-security-egd-option-is-for/59097932#59097932
fi
MAVEN_OPTS+=" -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS" # https://stackoverflow.com/questions/5120470/how-to-time-the-different-stages-of-maven-execution/49494561#49494561
MAVEN_OPTS+=" -Xmx1024m -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Dhttps.protocols=TLSv1.3,TLSv1.2"
export MAVEN_OPTS
echo "MAVEN_OPTS: $MAVEN_OPTS"

if [[ ${ACT:-} == "true" ]]; then # when running locally using nektos/act
maven_args="-Djgit.dirtyWorkingTree=warning"
else
maven_args="--no-transfer-progress"
fi

# prevent "org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]" on Linux
${{ runner.os == 'Linux' && 'xvfb-run --auto-servernum --server-args="-screen 0 1600x900x24" \' || '' }}
mvn \
--errors \
--update-snapshots \
--batch-mode \
--show-version \
-Dtycho.disableP2Mirrors=true \
-Dsurefire.rerunFailingTestsCount=3 \
$maven_args \
${{ github.event.inputs.additional_maven_args }} \
clean verify || (
rc=$?
if [[ ${ACT:-} != "true" ]]; then
find . -path "*/target/work/data/.metadata/.log" | while IFS= read -r file; do
echo "::group::$file"
cat "$file"
echo "::endgroup::"
done
fi
exit $rc
)
uses: nick-fields/retry@v3
with:
max_attempts: 3
timeout_minutes: 10
shell: bash
command: |
set -eu

MAVEN_OPTS="${MAVEN_OPTS:-}"
if [[ "${{ runner.os }}" == "Windows" ]]; then
MAVEN_OPTS+=" -Djava.security.egd=file:/dev/urandom" # https://www.baeldung.com/java-security-egd#bd-testing-the-effect-of-javasecurityegd
else
MAVEN_OPTS+=" -Djava.security.egd=file:/dev/./urandom" # https://stackoverflow.com/questions/58991966/what-java-security-egd-option-is-for/59097932#59097932
fi
MAVEN_OPTS+=" -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS" # https://stackoverflow.com/questions/5120470/how-to-time-the-different-stages-of-maven-execution/49494561#49494561
MAVEN_OPTS+=" -Xmx1024m -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Dhttps.protocols=TLSv1.3,TLSv1.2"
export MAVEN_OPTS
echo "MAVEN_OPTS: $MAVEN_OPTS"

if [[ ${ACT:-} == "true" ]]; then # when running locally using nektos/act
maven_args="-Djgit.dirtyWorkingTree=warning"
else
maven_args="--no-transfer-progress"
fi

# prevent "org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]" on Linux
${{ runner.os == 'Linux' && 'xvfb-run --auto-servernum --server-args="-screen 0 1600x900x24" \' || '' }}
mvn \
--errors \
--update-snapshots \
--batch-mode \
--show-version \
-Dtycho.disableP2Mirrors=true \
-Dsurefire.rerunFailingTestsCount=3 \
$maven_args \
${{ github.event.inputs.additional_maven_args }} \
clean verify || (
rc=$?
if [[ ${ACT:-} != "true" ]]; then
find . -path "*/target/work/data/.metadata/.log" | while IFS= read -r file; do
echo "::group::$file"
cat "$file"
echo "::endgroup::"
done
fi
exit $rc
)


##################################################
Expand Down
Loading