4242 with :
4343 components : clippy
4444 targets : wasm32-unknown-unknown
45+ # lint plotly_static for all features
46+ - run : cargo clippy -p plotly_static --features geckodriver,webdriver_download -- -D warnings -A deprecated
47+ - run : cargo clippy -p plotly_static --features chromedriver,webdriver_download -- -D warnings -A deprecated
4548 # lint the main library workspace for non-wasm target
4649 - run : cargo clippy --features all -- -D warnings -A deprecated
4750 # lint the non-wasm examples
@@ -70,17 +73,37 @@ jobs:
7073 strategy :
7174 fail-fast : false
7275 matrix :
73- os : [ubuntu-latest, windows-latest, macos-latest]
76+ include :
77+ - os : ubuntu-latest
78+ browser : chrome
79+ features : plotly_ndarray,plotly_image,static_export_default,ci
80+ - os : ubuntu-latest
81+ browser : firefox
82+ features : plotly_ndarray,plotly_image,static_export_geckodriver,static_export_wd_download,ci
83+ - os : windows-latest
84+ browser : chrome
85+ features : plotly_ndarray,plotly_image,static_export_chromedriver,ci
86+ - os : macos-latest
87+ browser : chrome
88+ features : plotly_ndarray,plotly_image,static_export_default,ci
7489 runs-on : ${{ matrix.os }}
7590 timeout-minutes : ${{ matrix.os == 'windows-latest' && 30 || 10 }}
7691 steps :
7792 - name : Setup Chrome
93+ if : matrix.browser == 'chrome'
7894 uses : browser-actions/setup-chrome@v1
7995 with :
8096 chrome-version : ' latest'
8197 install-chromedriver : true
8298 id : setup-chrome
8399
100+ - name : Setup Firefox
101+ if : matrix.browser == 'firefox'
102+ uses : browser-actions/setup-firefox@v1
103+ with :
104+ firefox-version : ' latest'
105+ id : setup-firefox
106+
84107 - uses : actions/checkout@v4
85108
86109 - uses : dtolnay/rust-toolchain@stable
@@ -106,14 +129,41 @@ jobs:
106129 -ChromePath "${{ steps.setup-chrome.outputs.chrome-path }}" `
107130 -ChromeDriverPath "${{ steps.setup-chrome.outputs.chromedriver-path }}"
108131
109- # Run tests on non-Windows platforms
110- - name : Run tests (${{ matrix.os }})
111- if : matrix.os != 'windows-latest'
112- run : cargo test --verbose --workspace --features plotly_ndarray,plotly_image,static_export_default --exclude plotly_kaleido
132+ # Run tests on Ubuntu with Chrome
133+ - name : Run tests (${{ matrix.os }} - Chrome)
134+ if : matrix.os == 'ubuntu-latest' && matrix.browser == 'chrome'
135+ run : cargo test --workspace --features ${{ matrix.features }} --exclude plotly_kaleido
136+
137+ # Install xvfb for Firefox WebGL support
138+ - name : Install xvfb
139+ if : matrix.os == 'ubuntu-latest' && matrix.browser == 'firefox'
140+ run : |
141+ sudo apt-get update
142+ sudo apt-get install -y xvfb
143+
144+ # Run tests on Ubuntu with Firefox
145+ - name : Run tests (${{ matrix.os }} - Firefox)
146+ if : matrix.os == 'ubuntu-latest' && matrix.browser == 'firefox'
147+ run : |
148+ # Set environment variables for Firefox WebDriver
149+ export BROWSER_PATH="${{ steps.setup-firefox.outputs.firefox-path }}"
150+ export RUST_LOG="debug"
151+ export RUST_BACKTRACE="1"
152+
153+ echo "Environment variables set:"
154+ echo "BROWSER_PATH: $BROWSER_PATH"
155+ echo "RUST_LOG: $RUST_LOG"
156+
157+ xvfb-run -s "-screen 0 1920x1080x24" cargo test --workspace --features ${{ matrix.features }} --exclude plotly_kaleido
158+
159+ # Run tests on macOS with Chrome
160+ - name : Run tests (${{ matrix.os }} - Chrome)
161+ if : matrix.os == 'macos-latest' && matrix.browser == 'chrome'
162+ run : cargo test --workspace --features ${{ matrix.features }} --exclude plotly_kaleido
113163
114164 # Run tests on Windows with Chrome WebDriver
115- - name : Run tests (${{ matrix.os }})
116- if : matrix.os == 'windows-latest'
165+ - name : Run tests (${{ matrix.os }} - Chrome )
166+ if : matrix.os == 'windows-latest' && matrix.browser == 'chrome'
117167 shell : pwsh
118168 run : |
119169 # Set environment variables for WebDriver
@@ -127,13 +177,13 @@ jobs:
127177 Write-Host "WEBDRIVER_PATH: $env:WEBDRIVER_PATH"
128178 Write-Host "BROWSER_PATH: $env:BROWSER_PATH"
129179
130- cargo test --verbose -- workspace --features plotly_ndarray,plotly_image,static_export_chromedriver --exclude plotly_kaleido
180+ cargo test --workspace --features ${{ matrix.features }} --exclude plotly_kaleido
131181
132182 - name : Upload example.pdf artifact
133183 uses : actions/upload-artifact@v4
134184 with :
135- name : example-pdf-${{ matrix.os }}
136- path : ${{ github.workspace }}/plotly_static/example.pdf
185+ name : example-pdf-${{ matrix.os }}-${{ matrix.browser }}
186+ path : ${{ github.workspace }}/plotly_static/example.*
137187 retention-days : 30
138188
139189 code-coverage :
0 commit comments