Parcourir la source

Merge #51

51: CI fixes and improvements r=almindor a=Disasm



Co-authored-by: Vadim Kaushan <admin@disasm.info>
bors[bot] il y a 4 ans
Parent
commit
f0afce435d
3 fichiers modifiés avec 36 ajouts et 24 suppressions
  1. 15 7
      riscv-rt/.travis.yml
  2. 11 9
      riscv-rt/ci/install.sh
  3. 10 8
      riscv-rt/ci/script.sh

+ 15 - 7
riscv-rt/.travis.yml

@@ -13,18 +13,26 @@ env:
 
 if: (branch = staging OR branch = trying OR branch = master) OR (type = pull_request AND branch = master)
 
-before_install: set -e
+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:
-  - bash ci/install.sh
-  - export PATH="$PATH:$PWD/gcc/bin"
+  - ci/install.sh
 
 script:
-  - bash ci/script.sh
-
-after_script: set +e
+  - ci/script.sh
 
-cache: cargo
+cache:
+  cargo: true
+  directories:
+    - gcc
 
 branches:
   only:

+ 11 - 9
riscv-rt/ci/install.sh

@@ -1,12 +1,14 @@
-set -euxo pipefail
+#!/usr/bin/env bash
 
-main() {
-    if [ $TARGET != x86_64-unknown-linux-gnu ]; then
-        rustup target add $TARGET
-    fi
+set -euxo pipefail
 
-    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 "${TARGET:-}" ]; then
+    rustup target add $TARGET
+fi
 
-main
+if [ -n "${CHECK_BLOBS:-}" ]; then
+    if [ ! -d gcc/bin ]; then
+        mkdir -p 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 - 8
riscv-rt/ci/script.sh

@@ -1,18 +1,20 @@
+#!/usr/bin/env bash
+
 set -euxo pipefail
 
-main() {
+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'
-    fi
-
-    if [ $TARGET = x86_64-unknown-linux-gnu ]; then
-        ./check-blobs.sh
+        cargo check --target $TARGET --features inline-asm
     fi
-}
+fi
 
-main
+if [ -n "${CHECK_BLOBS:-}" ]; then
+    PATH="$PATH:$PWD/gcc/bin"
+    ./check-blobs.sh
+fi