Browse Source

Merge pull request #973 from mnaamani/travis-skip-rust

Travis: skip rust build in PRs that do not modify rust/cargo files
Mokhtar Naamani 4 năm trước cách đây
mục cha
commit
e1b86026bf
1 tập tin đã thay đổi với 12 bổ sung0 xóa
  1. 12 0
      .travis.yml

+ 12 - 0
.travis.yml

@@ -17,6 +17,18 @@ matrix:
     - os: linux
       env: TARGET=x86_64-unknown-linux-gnu
 
+# Skip Rust build in a pull request if no rust project files were modified
+before_install:
+  - |
+    if [ "$TRAVIS_PULL_REQUEST" != "false" ]
+      then
+      if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qE "(.rs|Cargo.(lock|toml))$"
+        then
+        echo "No changes to Rust or Cargo Files, CI not running."
+        travis_terminate 0
+      fi
+    fi
+
 install:
   - rustup install nightly-2020-05-23
   - rustup target add wasm32-unknown-unknown --toolchain nightly-2020-05-23