Skip to content

Fix GitHub action headless browser tests #354

Fix GitHub action headless browser tests

Fix GitHub action headless browser tests #354

Workflow file for this run

name: 🧪 Tests and Checks
on:
push:
branches: [ main ]
pull_request:
branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
run-checks:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust-toolchain:
- stable
- nightly
steps:
- name: Checkout Repository
uses: actions/checkout@v3
# Smarter caching action, speeds up build times compared to regular cache:
# https://github.com/Swatinem/rust-cache
- name: Cache Project
uses: Swatinem/rust-cache@v2
- name: Install Rust Toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust-toolchain }}
components: clippy, rustfmt
- name: Check Format
run: cargo +${{ matrix.rust-toolchain }} fmt --all -- --check
- name: Run Linter
run: cargo +${{ matrix.rust-toolchain }} clippy --all -- -D warnings
- name: Install Cargo Audit
if: ${{ matrix.rust-toolchain == 'stable' }}
run: cargo install --force cargo-audit
- name: Run Audit on Deps
if: ${{ matrix.rust-toolchain == 'stable' }}
run: cargo-audit audit
# Only "test" release build on push event.
- name: Test Release
if: ${{ matrix.rust-toolchain == 'stable' && github.event_name == 'push' }}
run: cargo build --release
run-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust-toolchain:
- stable
- nightly
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install Environment Packages
run: |
sudo apt-get update -qqy
sudo apt-get install jq
- name: Cache Project
uses: Swatinem/rust-cache@v2
- name: Install Rust Toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust-toolchain }}
- name: Run Tests
run: cargo test --all
- name: Install Rust/WASM Test Dependencies
run: |
rustup target install wasm32-unknown-unknown
cargo install toml-cli
WASM_BINDGEN_VERSION=`toml get ./Cargo.lock . | jq '.package | map(select(.name == "wasm-bindgen"))[0].version' | xargs echo`
cargo install wasm-bindgen-cli --vers "$WASM_BINDGEN_VERSION"
- name: Setup Chrome and Chromedriver
uses: nanasess/setup-chromedriver@v2
- name: Run Rust Headless Browser Tests
run: CHROMEDRIVER=/usr/local/bin/chromedriver cargo test --target wasm32-unknown-unknown