name: Rust

on: [push]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v1
    - name: Setup firefox
      uses: browser-actions/setup-firefox@latest
      with:
        firefox-version: ${{ matrix.firefox }}
    - run: firefox --version

    - name: Install nightly
      run: rustup toolchain install nightly && rustup override set nightly && cargo install wasm-pack

    - name: Build no features
      run: cargo build --all --no-default-features

    - name: Build with all features
      run: cargo build --all --all-features

    - name: Build with dom features
      run: cargo build --all --features "with-dom"


    - name: Run tests no features
      run: cargo test --all --no-default-features

    - name: Run tests with dom features
      run: cargo test --all --features "with-dom with-measure"

    - name: Run test on wasm bindgen
      run: wasm-pack test --firefox --headless

