1515 paths :
1616 - ' examples/java/**'
1717
18+ concurrency :
19+ group : ${{ github.workflow }}-${{ github.ref }}
20+ cancel-in-progress : true
21+
1822env :
1923 DISPLAY : :99
2024 GITHUB_TOKEN : ${{ secrets.SELENIUM_CI_TOKEN }}
3034 runs-on : ${{ format('{0}-latest', matrix.os) }}
3135 steps :
3236 - name : Checkout GitHub repo
33- uses : actions/checkout@v4
37+ uses : actions/checkout@v6
3438 - name : Remove driver directories Windows
3539 if : matrix.os == 'windows'
3640 run : |
@@ -45,43 +49,82 @@ jobs:
4549 if : matrix.os == 'ubuntu'
4650 run : Xvfb :99 &
4751 - name : Set up Java
48- uses : actions/setup-java@v4
52+ id : java
53+ uses : actions/setup-java@v5
4954 with :
5055 distribution : ' temurin'
51- java-version : 11
52- - name : Run Tests Stable
56+ java-version : 17
57+ - name : Import test cert non-Windows
58+ if : matrix.os != 'windows'
59+ run : sudo keytool -import -noprompt -trustcacerts -alias SeleniumHQ -file examples/java/src/test/resources/tls.crt -keystore ${{ steps.java.outputs.path }}/lib/security/cacerts -storepass changeit
60+ - name : Import test cert Windows
61+ if : matrix.os == 'windows'
62+ run : keytool -import -noprompt -trustcacerts -alias SeleniumHQ -file examples/java/src/test/resources/tls.crt -keystore ${{ steps.java.outputs.path }}/lib/security/cacerts -storepass changeit
63+ - name : Run Tests Stable (in Maven)
64+ if : matrix.release == 'stable'
65+ uses :
nick-invision/[email protected] 66+ with :
67+ timeout_minutes : 40
68+ max_attempts : 3
69+ command : |
70+ cd examples/java
71+ mvn -B test -D"jdk.internal.httpclient.disableHostnameVerification=true"
72+ - name : Run Tests Stable (in Gradle)
5373 if : matrix.release == 'stable'
54- uses :
nick-invision/[email protected] .0 74+ uses :
nick-invision/[email protected] .2 5575 with :
56- timeout_minutes : 20
76+ timeout_minutes : 40
5777 max_attempts : 3
5878 command : |
5979 cd examples/java
60- mvn -B test
80+ ./gradlew test --tests 'dev.selenium.*UsingSeleniumTest'
6181 - name : Run Tests Nightly Linux/macOS
6282 if : matrix.release == 'nightly' && matrix.os != 'windows'
63- uses :
nick-invision/[email protected] .0 83+ uses :
nick-invision/[email protected] .2 6484 with :
65- timeout_minutes : 20
85+ timeout_minutes : 40
6686 max_attempts : 3
6787 command : |
68- pip install yq
69- xml_content=$(curl -sf https://oss.sonatype.org/service/local/repositories/snapshots/content/org/seleniumhq/selenium/selenium-java/)
70- latest_snapshot=$(echo $xml_content | xq '.content.data."content-item"' | jq -r 'sort_by(.lastModified) | reverse | .[0] | .text')
71- echo $latest_snapshot
72- cd examples/java
73- mvn -B -U test -Dselenium.version="$latest_snapshot"
74-
88+ # Get current selenium.version from Maven
89+ current_version=$(mvn -f examples/java/pom.xml help:evaluate -Dexpression=selenium.version -q -DforceStdout)
90+ echo "Current selenium.version: $current_version"
91+ # If version is in the form X.Y.Z, bump minor and set to SNAPSHOT
92+ if [[ $current_version =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then
93+ major="${BASH_REMATCH[1]}"
94+ minor="${BASH_REMATCH[2]}"
95+ next_minor=$((minor + 1))
96+ new_version="$major.$next_minor.0-SNAPSHOT"
97+ echo "Using selenium.version $new_version for tests"
98+ cd examples/java
99+ mvn -B -U test -D"jdk.internal.httpclient.disableHostnameVerification=true" -Dselenium.version=$new_version
100+ fi
75101 - name : Run Tests Nightly Windows
76102 if : matrix.release == 'nightly' && matrix.os == 'windows'
77- uses :
nick-invision/[email protected] .0 103+ uses :
nick-invision/[email protected] .2 78104 with :
79- timeout_minutes : 20
105+ timeout_minutes : 40
80106 max_attempts : 3
81107 command : |
82- pip install yq
83- $xml_content = Invoke-WebRequest -Uri "https://oss.sonatype.org/service/local/repositories/snapshots/content/org/seleniumhq/selenium/selenium-java/"
84- $latest_snapshot = $xml_content.Content | xq '.content.data.\"content-item\"' | jq -r 'sort_by(.lastModified) | reverse | .[0] | .text'
85- Write-Output $latest_snapshot
86- cd examples/java
87- mvn -B -U test "-Dselenium.version=$latest_snapshot"
108+ # Get current selenium.version from Maven
109+ $current_version = & mvn -f examples/java/pom.xml help:evaluate -Dexpression=selenium.version -q -DforceStdout
110+ Write-Output "Current selenium.version: $current_version"
111+ # If version is in the form X.Y.Z, bump minor and set to SNAPSHOT
112+ if ($current_version -match '^([0-9]+)\.([0-9]+)\.([0-9]+)$') {
113+ $major = $matches[1]
114+ $minor = $matches[2]
115+ $next_minor = [int]$minor + 1
116+ $new_version = "$major.$next_minor.0-SNAPSHOT"
117+ Write-Output "Using selenium.version $new_version for tests"
118+ cd examples/java
119+ mvn -B -U test "-Djdk.internal.httpclient.disableHostnameVerification=true" "-Dselenium.version=$new_version"
120+ }
121+ - name : Upload test report
122+ uses : actions/upload-artifact@v6
123+ if : failure()
124+ with :
125+ name : test-report-${{matrix.os}}-${{matrix.release}}
126+ retention-days : 14
127+ path : |
128+ examples/java/target/surefire-reports
129+ examples/java/build/reports
130+ examples/java/build/test-results
0 commit comments