Browse Source

Check blobs in a separate target

Vadim Kaushan 5 years ago
parent
commit
4ea6ec4019
3 changed files with 23 additions and 10 deletions
  1. 6 0
      riscv-rt/.travis.yml
  2. 7 3
      riscv-rt/ci/install.sh
  3. 10 7
      riscv-rt/ci/script.sh

+ 6 - 0
riscv-rt/.travis.yml

@@ -16,6 +16,12 @@ if: (branch = staging OR branch = trying OR branch = master) OR (type = pull_req
 matrix:
   allow_failures:
     - rust: nightly
+  include:
+    - env: CHECK_BLOBS=1
+      rust:
+      language: bash
+      if: (branch = staging OR branch = trying OR branch = master) OR (type = pull_request AND branch = master)
+
 
 install:
   - ci/install.sh

+ 7 - 3
riscv-rt/ci/install.sh

@@ -2,9 +2,13 @@
 
 set -euxo pipefail
 
-if [ $TARGET != x86_64-unknown-linux-gnu ]; then
+if [ -n "${TARGET:-}" ]; then
     rustup target add $TARGET
 fi
 
-mkdir gcc
-curl -L https://static.dev.sifive.com/dev-tools/riscv64-unknown-elf-gcc-8.1.0-2018.12.0-x86_64-linux-ubuntu14.tar.gz | tar --strip-components=1 -C gcc -xz
+if [ -n "${CHECK_BLOBS:-}" ]; then
+    if [ ! -d gcc/bin ]; then
+        mkdir gcc
+        curl -L https://static.dev.sifive.com/dev-tools/riscv64-unknown-elf-gcc-8.1.0-2018.12.0-x86_64-linux-ubuntu14.tar.gz | tar --strip-components=1 -C gcc -xz
+    fi
+fi

+ 10 - 7
riscv-rt/ci/script.sh

@@ -2,16 +2,19 @@
 
 set -euxo pipefail
 
-cargo check --target $TARGET
-if [[ $TARGET == riscv* ]]; then
-    cargo check --target $TARGET --examples
-fi
+if [ -n "${TARGET:-}" ]; then
+    cargo check --target $TARGET
+
+    if [[ $TARGET == riscv* ]]; then
+        cargo check --target $TARGET --examples
+    fi
 
-if [ $TRAVIS_RUST_VERSION = nightly ]; then
-    cargo check --target $TARGET --features 'inline-asm'
+    if [ $TRAVIS_RUST_VERSION = nightly ]; then
+        cargo check --target $TARGET --features inline-asm
+    fi
 fi
 
-if [ $TARGET = x86_64-unknown-linux-gnu ]; then
+if [ -n "${CHECK_BLOBS:-}" ]; then
     PATH="$PATH:$PWD/gcc/bin"
     ./check-blobs.sh
 fi