aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jorge Aparicio <japaricious@gmail.com> 2016-10-06 21:27:12 -0500
committerGravatar Jorge Aparicio <japaricious@gmail.com> 2016-10-06 21:27:12 -0500
commit01464c27b8e6a8941df2eb4f5ca8907b3e12a82a (patch)
tree8a7af76cf343c1618bee787a8c1137cd22ae3a54
parent7054789402019fc5b32f2236714f85ea0418b6e6 (diff)
downloadcortex-m-01464c27b8e6a8941df2eb4f5ca8907b3e12a82a.tar.gz
cortex-m-01464c27b8e6a8941df2eb4f5ca8907b3e12a82a.tar.zst
cortex-m-01464c27b8e6a8941df2eb4f5ca8907b3e12a82a.zip
enable cache and drop target files
-rw-r--r--.travis.yml9
-rw-r--r--ci/docker/thumbv6m-none-eabi/Dockerfile8
-rw-r--r--ci/docker/thumbv7em-none-eabi/Dockerfile8
-rw-r--r--ci/docker/thumbv7em-none-eabihf/Dockerfile8
-rw-r--r--ci/docker/thumbv7m-none-eabi/Dockerfile8
-rwxr-xr-xci/run-docker.sh25
-rw-r--r--thumbv6m-none-eabi.json9
-rw-r--r--thumbv7em-none-eabi.json8
-rw-r--r--thumbv7em-none-eabihf.json9
-rw-r--r--thumbv7m-none-eabi.json8
10 files changed, 47 insertions, 53 deletions
diff --git a/.travis.yml b/.travis.yml
index 1e9ac4f..b05f8d0 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,3 +1,4 @@
+cache: cargo
dist: trusty
language: rust
rust: nightly
@@ -5,20 +6,18 @@ services: docker
sudo: required
matrix:
- exclude:
- # first, clear the matrix
- - rust: nightly
- # then add the targets one by one
include:
- - env: TARGET=x86_64-unknown-linux-gnu
- env: TARGET=thumbv6m-none-eabi
- env: TARGET=thumbv7m-none-eabi
- env: TARGET=thumbv7em-none-eabi
- env: TARGET=thumbv7em-none-eabihf
+env: TARGET=x86_64-unknown-linux-gnu
script:
- cargo generate-lockfile
- sh ci/run-docker.sh $TARGET
+ # Travis can't cache files that are not readable by "others"
+ - chmod -R a+r $HOME/.cargo
branches:
only:
diff --git a/ci/docker/thumbv6m-none-eabi/Dockerfile b/ci/docker/thumbv6m-none-eabi/Dockerfile
index 25bf548..fa5439a 100644
--- a/ci/docker/thumbv6m-none-eabi/Dockerfile
+++ b/ci/docker/thumbv6m-none-eabi/Dockerfile
@@ -1,5 +1,9 @@
FROM ubuntu:16.04
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
- ca-certificates curl libcurl4-openssl-dev libssh2-1
-ENV PATH=$PATH:/rust/bin
+ ca-certificates \
+ curl \
+ libcurl4-openssl-dev \
+ libssh2-1
+RUN curl -sf "https://raw.githubusercontent.com/japaric/rust-everywhere/master/install.sh" | \
+ bash -s -- --at /usr/bin --from japaric/xargo --for x86_64-unknown-linux-gnu --tag v0.1.13
diff --git a/ci/docker/thumbv7em-none-eabi/Dockerfile b/ci/docker/thumbv7em-none-eabi/Dockerfile
index 25bf548..fa5439a 100644
--- a/ci/docker/thumbv7em-none-eabi/Dockerfile
+++ b/ci/docker/thumbv7em-none-eabi/Dockerfile
@@ -1,5 +1,9 @@
FROM ubuntu:16.04
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
- ca-certificates curl libcurl4-openssl-dev libssh2-1
-ENV PATH=$PATH:/rust/bin
+ ca-certificates \
+ curl \
+ libcurl4-openssl-dev \
+ libssh2-1
+RUN curl -sf "https://raw.githubusercontent.com/japaric/rust-everywhere/master/install.sh" | \
+ bash -s -- --at /usr/bin --from japaric/xargo --for x86_64-unknown-linux-gnu --tag v0.1.13
diff --git a/ci/docker/thumbv7em-none-eabihf/Dockerfile b/ci/docker/thumbv7em-none-eabihf/Dockerfile
index 25bf548..fa5439a 100644
--- a/ci/docker/thumbv7em-none-eabihf/Dockerfile
+++ b/ci/docker/thumbv7em-none-eabihf/Dockerfile
@@ -1,5 +1,9 @@
FROM ubuntu:16.04
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
- ca-certificates curl libcurl4-openssl-dev libssh2-1
-ENV PATH=$PATH:/rust/bin
+ ca-certificates \
+ curl \
+ libcurl4-openssl-dev \
+ libssh2-1
+RUN curl -sf "https://raw.githubusercontent.com/japaric/rust-everywhere/master/install.sh" | \
+ bash -s -- --at /usr/bin --from japaric/xargo --for x86_64-unknown-linux-gnu --tag v0.1.13
diff --git a/ci/docker/thumbv7m-none-eabi/Dockerfile b/ci/docker/thumbv7m-none-eabi/Dockerfile
index 25bf548..fa5439a 100644
--- a/ci/docker/thumbv7m-none-eabi/Dockerfile
+++ b/ci/docker/thumbv7m-none-eabi/Dockerfile
@@ -1,5 +1,9 @@
FROM ubuntu:16.04
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
- ca-certificates curl libcurl4-openssl-dev libssh2-1
-ENV PATH=$PATH:/rust/bin
+ ca-certificates \
+ curl \
+ libcurl4-openssl-dev \
+ libssh2-1
+RUN curl -sf "https://raw.githubusercontent.com/japaric/rust-everywhere/master/install.sh" | \
+ bash -s -- --at /usr/bin --from japaric/xargo --for x86_64-unknown-linux-gnu --tag v0.1.13
diff --git a/ci/run-docker.sh b/ci/run-docker.sh
index 85b2c28..5a4762d 100755
--- a/ci/run-docker.sh
+++ b/ci/run-docker.sh
@@ -1,18 +1,31 @@
set -ex
run() {
- echo $1
+ local target=$1
- docker build -t rust ci/docker/$1
+ echo $target
+
+ # This directory needs to exist before calling docker, otherwise docker will create it but it
+ # will be owned by root
+ mkdir -p target
+
+ docker build -t $target ci/docker/$target
docker run \
- -v `rustc --print sysroot`:/rust:ro \
+ --rm \
+ --user $(id -u):$(id -g) \
+ -e CARGO_HOME=/cargo \
+ -e CARGO_TARGET_DIR=/target \
+ -e HOME=/tmp \
+ -v $HOME/.cargo:/cargo \
+ -v `pwd`/target:/target \
-v `pwd`:/checkout:ro \
- -e CARGO_TARGET_DIR=/tmp/target \
+ -v `rustc --print sysroot`:/rust:ro \
-w /checkout \
- -it rust \
- ci/run.sh $1
+ -it $target \
+ sh -c "PATH=\$PATH:/rust/bin ci/run.sh $target"
}
+
if [ -z "$1" ]; then
for d in `ls ci/docker/`; do
run $d
diff --git a/thumbv6m-none-eabi.json b/thumbv6m-none-eabi.json
deleted file mode 100644
index 4a31e30..0000000
--- a/thumbv6m-none-eabi.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "arch": "arm",
- "data-layout": "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64",
- "features": "+strict-align",
- "llvm-target": "thumbv6m-none-eabi",
- "os": "none",
- "target-endian": "little",
- "target-pointer-width": "32"
-}
diff --git a/thumbv7em-none-eabi.json b/thumbv7em-none-eabi.json
deleted file mode 100644
index ce49c83..0000000
--- a/thumbv7em-none-eabi.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "arch": "arm",
- "data-layout": "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64",
- "llvm-target": "thumbv7em-none-eabi",
- "os": "none",
- "target-endian": "little",
- "target-pointer-width": "32"
-}
diff --git a/thumbv7em-none-eabihf.json b/thumbv7em-none-eabihf.json
deleted file mode 100644
index bb0b87e..0000000
--- a/thumbv7em-none-eabihf.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "arch": "arm",
- "data-layout": "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64",
- "features": "+vfp4",
- "llvm-target": "thumbv7em-none-eabihf",
- "os": "none",
- "target-endian": "little",
- "target-pointer-width": "32"
-}
diff --git a/thumbv7m-none-eabi.json b/thumbv7m-none-eabi.json
deleted file mode 100644
index 313a5e6..0000000
--- a/thumbv7m-none-eabi.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "arch": "arm",
- "data-layout": "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64",
- "llvm-target": "thumbv7m-none-eabi",
- "os": "none",
- "target-endian": "little",
- "target-pointer-width": "32"
-}