Jorge Aparicio 7 years ago
parent
commit
bab5fba9a7
3 changed files with 62 additions and 0 deletions
  1. 36 0
      .travis.yml
  2. 12 0
      ci/install.sh
  3. 14 0
      ci/script.sh

+ 36 - 0
.travis.yml

@@ -0,0 +1,36 @@
+language: rust
+
+matrix:
+  include:
+    - env: TARGET=thumbv7m-none-eabi
+      rust: nightly
+    - env: TARGET=x86_64-unknown-linux-gnu
+      rust: nightly
+
+before_install: set -e
+
+install:
+  - bash ci/install.sh
+
+script:
+  - bash ci/script.sh
+
+after_script: set +e
+
+after_success:
+  - bash ci/after_success.sh
+
+cache: cargo
+before_cache:
+  # Travis can't cache files that are not readable by "others"
+  - chmod -R a+r $HOME/.cargo
+
+branches:
+  only:
+    - auto
+    - master
+    - try
+
+notifications:
+  email:
+    on_success: never

+ 12 - 0
ci/install.sh

@@ -0,0 +1,12 @@
+set -euxo pipefail
+
+main() {
+    if [ $TARGET = thumbv7m-none-eabi ]; then
+        cargo install --list | grep xargo || \
+            cargo install xargo
+        rustup component list | grep 'rust-src.*installed' || \
+            rustup component add rust-src
+    fi
+}
+
+main

+ 14 - 0
ci/script.sh

@@ -0,0 +1,14 @@
+set -euxo pipefail
+
+main() {
+    local cargo=
+    if [ $TARGET = thumbv7m-none-eabi ]; then
+        cargo=xargo
+    else
+        cargo=cargo
+    fi
+
+    $cargo check --target $TARGET
+}
+
+main