.travis.yml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. language: rust
  2. # Caching of the runtime .wasm blob poses a problem.
  3. # See: https://github.com/Joystream/joystream/issues/466
  4. # Always starting with a clean slate is probably better, it allows us to ensure
  5. # the WASM runtime is always rebuilt. It also allows us to detect when certain upstream dependencies
  6. # sometimes break the build. When cache is enabled do not use the produced WASM build.
  7. # This also means the binary should not be used to produce the final chainspec file (because the same
  8. # one is embedded in the binary)
  9. cache: cargo
  10. rust:
  11. - stable
  12. matrix:
  13. include:
  14. - os: linux
  15. env: TARGET=x86_64-unknown-linux-gnu
  16. # Skip Rust build in a pull request if no rust project files were modified
  17. before_install:
  18. - |
  19. if [ "$TRAVIS_PULL_REQUEST" != "false" ]
  20. then
  21. if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qE "(.rs|Cargo.(lock|toml))$"
  22. then
  23. echo "No changes to Rust or Cargo Files, CI not running."
  24. travis_terminate 0
  25. fi
  26. fi
  27. install:
  28. - rustup install nightly-2020-05-23
  29. - rustup target add wasm32-unknown-unknown --toolchain nightly-2020-05-23
  30. # travis installs rust using rustup with the "minimal" profile so these tools are not installed by default
  31. - rustup component add rustfmt
  32. - rustup component add clippy
  33. before_script:
  34. - cargo fmt --all -- --check
  35. script:
  36. # we set release as build type for all steps to benefit from already compiled packages in prior steps
  37. - BUILD_DUMMY_WASM_BINARY=1 cargo clippy --release --target=${TARGET} -- -D warnings
  38. - BUILD_DUMMY_WASM_BINARY=1 cargo test --release --verbose --all --target=${TARGET}
  39. - TRIGGER_WASM_BUILD=1 WASM_BUILD_TOOLCHAIN=nightly-2020-05-23 cargo build --release --target=${TARGET} -p joystream-node
  40. - ls -l ./target/${TARGET}/release/wbuild/joystream-node-runtime/