Skip to content

Release 4.22 Updates #1077

Release 4.22 Updates

Release 4.22 Updates #1077

Workflow file for this run

name: Run Java examples
on:
workflow_dispatch:
schedule:
- cron: '35 22 * * *'
pull_request:
branches:
- trunk
paths:
- 'examples/java/**'
push:
branches:
- trunk
paths:
- 'examples/java/**'
env:
DISPLAY: :99
GITHUB_TOKEN: ${{ secrets.SELENIUM_CI_TOKEN }}
GH_TOKEN: ${{ secrets.SELENIUM_CI_TOKEN }}
jobs:
tests:
strategy:
fail-fast: false
matrix:
os: [ ubuntu, windows, macos ]
release: [ stable, nightly ]
runs-on: ${{ format('{0}-latest', matrix.os) }}
steps:
- name: Checkout GitHub repo
uses: actions/checkout@v4
- name: Remove driver directories Windows
if: matrix.os == 'windows'
run: |
rm "$env:ChromeWebDriver" -r -v
rm "$env:EdgeWebDriver" -r -v
rm "$env:GeckoWebDriver" -r -v
- name: Remove driver directories Non-Windows
if: matrix.os != 'windows-latest'
run: |
sudo rm -rf $CHROMEWEBDRIVER $EDGEWEBDRIVER $GECKOWEBDRIVER
- name: Setup Chrome
uses: browser-actions/setup-chrome@latest
with:
chrome-version: stable
- name: Setup Firefox
uses: abhi1693/[email protected]
with:
browser: firefox
version: latest
- name: Setup Edge
uses: browser-actions/setup-edge@latest
with:
edge-version: stable
- name: Start Xvfb
if: matrix.os == ubuntu'

Check failure on line 58 in .github/workflows/java-examples.yml

View workflow run for this annotation

GitHub Actions / Run Java examples

Invalid workflow file

The workflow is not valid. .github/workflows/java-examples.yml (Line: 58, Col: 11): Unexpected symbol: 'ubuntu''. Located at position 14 within expression: matrix.os == ubuntu'
run: Xvfb :99 &
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 11
- name: Run Tests Stable
if: matrix.release == 'stable'
uses: nick-invision/[email protected]
with:
timeout_minutes: 20
max_attempts: 3
command: |
cd examples/java
mvn -B test
- name: Run Tests Nightly Linux/macOS
if: matrix.release == 'nightly' && matrix.os != 'windows-latest'
uses: nick-invision/[email protected]
with:
timeout_minutes: 20
max_attempts: 3
command: |
pip install yq
xml_content=$(curl -sf https://oss.sonatype.org/service/local/repositories/snapshots/content/org/seleniumhq/selenium/selenium-java/)
latest_snapshot=$(echo $xml_content | xq '.content.data."content-item"' | jq -r 'sort_by(.lastModified) | reverse | .[0] | .text')
echo $latest_snapshot
cd examples/java
mvn -B -U test -Dselenium.version="$latest_snapshot"
- name: Run Tests Nightly Windows
if: matrix.release == 'nightly' && matrix.os == 'windows'
uses: nick-invision/[email protected]
with:
timeout_minutes: 20
max_attempts: 3
command: |
pip install yq
$xml_content = Invoke-WebRequest -Uri "https://oss.sonatype.org/service/local/repositories/snapshots/content/org/seleniumhq/selenium/selenium-java/"
$latest_snapshot = $xml_content.Content | xq '.content.data.\"content-item\"' | jq -r 'sort_by(.lastModified) | reverse | .[0] | .text'
Write-Output $latest_snapshot
cd examples/java
mvn -B -U test "-Dselenium.version=$latest_snapshot"