Skip to content

Commit 901631c

Browse files
committed
add ci using static crate
Signed-off-by: Andrei Gherghescu <[email protected]>
1 parent fa80868 commit 901631c

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.github/workflows/ci.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,45 @@ jobs:
7474
- if: ${{ matrix.os == 'windows-latest' }}
7575
run: gci -recurse -filter "*example*"
7676

77+
test-static-export:
78+
name: Test Static Export
79+
strategy:
80+
fail-fast: false
81+
matrix:
82+
# os: [ubuntu-latest, windows-latest, macos-latest]
83+
os: [ubuntu-latest]
84+
# browser: [firefox, chrome]
85+
browser: [chrome]
86+
runs-on: ${{ matrix.os }}
87+
steps:
88+
- uses: actions/checkout@v4
89+
90+
- name: Setup Firefox
91+
if: matrix.browser == 'firefox'
92+
uses: browser-actions/setup-firefox@v1
93+
with:
94+
firefox-version: 'latest'
95+
96+
- name: Setup Chrome
97+
if: matrix.browser == 'chrome'
98+
uses: browser-actions/setup-chrome@v1
99+
with:
100+
chrome-version: 'latest'
101+
install-chromedriver: true
102+
install-dependencies: true
103+
104+
- uses: dtolnay/rust-toolchain@stable
105+
106+
- name: Test plotly and plotly_static
107+
run: |
108+
if [ "${{ matrix.browser }}" = "firefox" ]; then
109+
cargo test --features static_export_default --lib
110+
cd plotly_static && cargo test --features geckodriver,webdriver_download
111+
else
112+
cargo test --features static_export_chromedriver,static_export_downloader --lib
113+
cd plotly_static && cargo test --features chromedriver,webdriver_download
114+
fi
115+
77116
code-coverage:
78117
name: Code Coverage
79118
runs-on: ubuntu-latest
@@ -103,12 +142,20 @@ jobs:
103142
ndarray,
104143
scientific_charts,
105144
shapes,
145+
static_export,
106146
subplots,
107147
themes,
108148
]
109149
runs-on: ubuntu-latest
110150
steps:
111151
- uses: actions/checkout@v4
152+
153+
- name: Setup Firefox (for static_export)
154+
if: matrix.example == 'static_export'
155+
uses: browser-actions/setup-firefox@v1
156+
with:
157+
firefox-version: 'latest'
158+
112159
- uses: dtolnay/rust-toolchain@stable
113160
- run: cd ${{ github.workspace }}/examples/${{ matrix.example }} && cargo build
114161

@@ -131,6 +178,12 @@ jobs:
131178
runs-on: ubuntu-latest
132179
steps:
133180
- uses: actions/checkout@v4
181+
182+
- name: Setup Firefox (for static_export example)
183+
uses: browser-actions/setup-firefox@v1
184+
with:
185+
firefox-version: 'latest'
186+
134187
- uses: dtolnay/rust-toolchain@stable
135188
- run: cargo install mdbook --no-default-features --features search --vers "^0.4" --locked --quiet
136189
- name: Build examples to generate needed html files
@@ -143,5 +196,6 @@ jobs:
143196
cd ${{ github.workspace }}/examples/subplots && cargo run
144197
cd ${{ github.workspace }}/examples/shapes && cargo run
145198
cd ${{ github.workspace }}/examples/themes && cargo run
199+
cd ${{ github.workspace }}/examples/static_export && cargo run
146200
- name: Build book
147201
run: mdbook build docs/book

0 commit comments

Comments
 (0)