-
Notifications
You must be signed in to change notification settings - Fork 230
cache Cargo artifacts #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
cache: cargo | ||
dist: trusty | ||
language: rust | ||
services: docker | ||
|
@@ -45,13 +46,13 @@ install: | |
script: | ||
- cargo generate-lockfile | ||
- if [[ $TRAVIS_OS_NAME = "linux" ]]; then | ||
sudo apt-get remove -y qemu-user-static && | ||
sudo apt-get install -y qemu-user-static && | ||
sh ci/run-docker.sh $TARGET; | ||
else | ||
cargo test --target $TARGET && | ||
cargo test --target $TARGET --release; | ||
fi | ||
# Travis can't cache files that are not readable by "others" | ||
- chmod -R a+r $HOME/.cargo | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this still needed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, in case we ever add a dependency that brings a file that doesn't have the o+r bit set. FWIW, I originally found this problem with the bitflags crate; its .gitignore was |
||
|
||
branches: | ||
only: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,16 +4,27 @@ | |
set -ex | ||
|
||
run() { | ||
echo $1 | ||
docker build -t $1 ci/docker/$1 | ||
local target=$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 \ | ||
-v `pwd`:/checkout:ro \ | ||
-e CARGO_TARGET_DIR=/tmp/target \ | ||
-w /checkout \ | ||
--privileged \ | ||
-it $1 \ | ||
sh ci/run.sh $1 | ||
--rm \ | ||
--user $(id -u):$(id -g) \ | ||
-e CARGO_HOME=/cargo \ | ||
-e CARGO_TARGET_DIR=/target \ | ||
-v $HOME/.cargo:/cargo \ | ||
-v `pwd`/target:/target \ | ||
-v `pwd`:/checkout:ro \ | ||
-v `rustc --print sysroot`:/rust:ro \ | ||
-w /checkout \ | ||
-it $target \ | ||
sh -c "PATH=\$PATH:/rust/bin ci/run.sh $target" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks funny. Is there a way to extend PATH using the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, maybe:
I'm not sure if that works but if it doesn't my assumption would be no :( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This results in PATH='$PATH:/rust/bin' with a literal $PATH in there 😆. |
||
} | ||
|
||
if [ -z "$1" ]; then | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mysteriousThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was never needed AFAIK