walrus 0.14.0

A library for performing WebAssembly transformations
Documentation
language: rust
sudo: false

before_install:
  - target=x86_64-unknown-linux-musl
  - curl -L https://github.com/mozilla/sccache/releases/download/0.2.7/sccache-0.2.7-$target.tar.gz | tar xzf -
  - export PATH=$PATH:`pwd`/sccache-0.2.7-$target
  - export RUSTC_WRAPPER=sccache

before_script:
  - export RUST_BACKTRACE=1

after_script:
  - sccache -s

install:
  # Build WABT
  - git clone --recursive https://github.com/WebAssembly/wabt.git
  - mkdir wabt/build
  - cd wabt/build
  - cmake .. -DCMAKE_CXX_COMPILER_LAUNCHER=sccache
  - make -j 8
  - cd -
  - export PATH=$PATH:$(pwd)/wabt/build
  - which wasm2wat
  - which wat2wasm
  # Build binaryen
  - git clone --recursive https://github.com/WebAssembly/binaryen.git
  - mkdir binaryen/build
  - cd binaryen/build
  - cmake .. -DCMAKE_CXX_COMPILER_LAUNCHER=sccache
  - make -j 8
  - cd -
  - export PATH=$PATH:$(pwd)/binaryen/build/bin
  - which wasm-opt

matrix:
  include:
    # First up: some jobs to run our fuzzers a bit longer than the default when
    # we do `cargo test`.
    #
    # We run these first because they take the longest.
    - name: "fuzz-utils (stable)"
      rust: stable
      env:
        # 300 seconds = 5 minutes.
        - WALRUS_FUZZ_TIMEOUT=300
      script:
        |
          # When the fuzzing fails, the logs are too big for Travis, so just
          # show the relevant tail portion of the log.
          cargo test -p walrus-fuzz-utils > fuzz.log || {
              tail -n 1000 fuzz.log && exit 1
          }
    - name: "cargo fuzz run watgen (nightly)"
      rust: nightly
      script:
        |
          which cargo-fuzz || cargo install cargo-fuzz
          # When the fuzzing fails, the logs are too big for Travis, so just
          # show the relevant tail portion of the log.
          cargo fuzz run watgen -- -max_total_time=300 > fuzz.log 2>&1 || {
              tail -n 1000 fuzz.log && exit 1
          }
    - name: "cargo fuzz run wasm-opt-ttf (nightly)"
      rust: nightly
      script:
        |
          which cargo-fuzz || cargo install cargo-fuzz
          # When the fuzzing fails, the logs are too big for Travis, so just
          # show the relevant tail portion of the log.
          cargo fuzz run wasm-opt-ttf -- -max_total_time=300 > fuzz.log 2>&1 || {
              tail -n 1000 fuzz.log && exit 1
          }
    - name: "cargo fuzz run raw (nightly)"
      rust: nightly
      script:
        |
          which cargo-fuzz || cargo install cargo-fuzz
          # When the fuzzing fails, the logs are too big for Travis, so just
          # show the relevant tail portion of the log.
          cargo fuzz run raw -- -max_total_time=300 -rss_limit_mb=4096 > fuzz.log 2>&1 || {
              tail -n 1000 fuzz.log && exit 1
          }

    - name: "test (stable)"
      rust: stable
    - name: "test (beta)"
      rust: beta
    - name: "test (nightly)"
      rust: nightly

    - name: "check benches"
      rust: stable
      script:
        - cargo check --benches

script:
  - cargo build --all
  - cargo test --all
  - cargo test --features parallel
  - cargo test --features parallel --manifest-path crates/tests/Cargo.toml

notifications:
  email:
    on_success: never