Skip to content

fix: reduced test threds to 1, added chrome dependency on firefox test #5

fix: reduced test threds to 1, added chrome dependency on firefox test

fix: reduced test threds to 1, added chrome dependency on firefox test #5

Workflow file for this run

name: ci
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -D warnings
jobs:
lint:
name: fmt + clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: rustfmt
run: cargo fmt --all -- --check
- name: clippy
run: cargo clippy --workspace --all-targets -- -D warnings
unit:
name: unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: build
run: cargo build --workspace --all-targets
# Lib/bin/doc tests + the non-browser integration suites. The chrome
# and firefox suites spawn real browsers and run in dedicated jobs.
- name: cargo test (no browser)
run: |
cargo test --workspace --lib --bins
cargo test --workspace --doc
cargo test -p rustenium --tests -- --skip chrome --skip firefox
# Serialized (threads=1, firefox after chrome) — the browser downloader has no
# lock, so concurrent callers race the unzip. To parallelize, add a file lock
# in `rustenium/src/downloader.rs` (e.g. fs2::FileExt::lock_exclusive).
chrome-integration:
name: chrome integration
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- uses: browser-actions/setup-chrome@v1
with:
chrome-version: stable
- name: chrome tests
run: cargo test -p rustenium --test chrome -- --test-threads=1
firefox-integration:
name: firefox integration
needs: chrome-integration
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- uses: browser-actions/setup-firefox@v1
with:
firefox-version: latest
- name: firefox tests
run: cargo test -p rustenium --test firefox -- --test-threads=1