Skip to content
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

Improve build caching on CI #1902

Merged
merged 4 commits into from
Nov 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,21 @@ env:
- JOBS=1 # See https://git.io/vdao3 for details.
- DATABASE_URL=postgres://postgres:@localhost/cargo_registry_test
- TEST_DATABASE_URL=postgres://postgres:@localhost/cargo_registry_test
- CARGO_TARGET_DIR=target
- CARGO_INCREMENTAL=0
- PERCY_PARALLEL_TOTAL=2
# Percy secrets are included here to enable Percy's GitHub integration
# on community-submitted PRs
- PERCY_TOKEN=0d8707a02b19aebbec79bb0bf302b8d2fa95edb33169cfe41b084289596670b1
- PERCY_PROJECT=crates-io/crates.io
- PGPORT=5433
- PATH=$HOME/.cargo/bin:$PATH
- RUSTFLAGS="-C debuginfo=0"

install:
- sudo cp /etc/postgresql/10/main/pg_hba.conf /etc/postgresql/11/main/pg_hba.conf
- sudo systemctl restart postgresql@11-main
- script/ci/cargo-clean-on-new-rustc-version.sh
- cargo install --force diesel_cli --vers `cat .diesel_version` --no-default-features --features postgres && export PATH=$HOME/.cargo/bin:$PATH
- which diesel || cargo install diesel_cli --vers `cat .diesel_version` --no-default-features --features postgres

before_script:
- diesel database setup --locked-schema
Expand Down
2 changes: 1 addition & 1 deletion script/ci/cargo-clean-on-new-rustc-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e

manual_stamp_file=target/ci_manual_stamp
manual_stamp=7 # Change this to force a clean build on CI
manual_stamp=8 # Change this to force a clean build on CI

if [ -f $manual_stamp_file ]; then
if echo "$manual_stamp" | cmp -s $manual_stamp_file -; then
Expand Down
2 changes: 2 additions & 0 deletions script/ci/prune-cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,7 @@ for name in $bin_names; do
rm -v target/debug/deps/$normalized-*
done

rm -v target/.rustc_info.json

echo "Final cache size:"
du -hs target/debug