Skip to content

Commit 1806daa

Browse files
committed
Improve build times by caching cargo install artifacts for diesel, clippy, and rustfmt
The primary change is to set `CARGO_TARGET_DIR=target` which instructs `cargo install` to use the target/ directory which is cached between builds on travis. This is only available on recent nightlies so I've bumped clippy and rustfmt versions. Unfortunately, `ring v0.11.0` does not compile on recent nightlies and upstream provides no support for older versions. Therefore I've added a patch section to use a git repo that incorporates the fix and a few other cleanups. This issue would have broken the build soon anyway when rust 1.24 goes into beta. A few other changes: * only `npm install` on the stable job * removed travis-cargo which appears to be unused * removed rustfmt configuration options that were removed upstream
1 parent b4d49ac commit 1806daa

File tree

4 files changed

+15
-18
lines changed

4 files changed

+15
-18
lines changed

.rustfmt.toml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
fn_args_layout = "Block"
2-
array_layout = "Block"
3-
control_style = "Rfc"
4-
where_style = "Rfc"
5-
generics_indent = "Block"
6-
fn_call_style = "Block"
71
combine_control_expr = true
8-
fn_args_paren_newline = false
92
max_width = 100
103
error_on_line_overflow = false
114
write_mode = "Overwrite"

.travis.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ before_install:
2121
- nvm install 8
2222

2323
install:
24-
- pip install 'travis-cargo<0.2' --user && export PATH=$HOME/.local/bin:$PATH
25-
- npm install
26-
- cargo install --force diesel_cli --vers 0.16.0 --debug --no-default-features --features postgres && export PATH=$HOME/.cargo/bin:$PATH
24+
- cargo install --force diesel_cli --vers 1.0.0-rc1 --debug --no-default-features --features postgres && export PATH=$HOME/.cargo/bin:$PATH
2725

2826
before_script:
2927
- diesel database setup
@@ -44,16 +42,17 @@ matrix:
4442
allow_failures:
4543
- rust: nightly
4644
include:
47-
- rust: nightly-2017-11-07
45+
- rust: nightly-2017-12-28
4846
script:
49-
- cargo install --force rustfmt-nightly --vers 0.2.15
50-
- cargo install --force clippy --vers 0.0.169
47+
- cargo install --force rustfmt-nightly --vers 0.3.4
5148
- cargo fmt -- --write-mode=diff
49+
- cargo install --force clippy --vers 0.0.177
5250
- cargo clippy
5351
- rust: stable
5452
script:
5553
- cargo build
5654
- cargo test
55+
- npm install
5756
- npm test
5857
- rust: beta
5958
script:
@@ -68,6 +67,7 @@ env:
6867
global:
6968
- DATABASE_URL=postgres://postgres:@localhost/cargo_registry_test
7069
- TEST_DATABASE_URL=postgres://postgres:@localhost/cargo_registry_test
70+
- CARGO_TARGET_DIR=target
7171

7272
notifications:
7373
email:

Cargo.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,7 @@ tokio-service = "0.1"
8484
dotenv = "0.10"
8585
diesel = { version = "1.0.0-beta1", features = ["postgres"] }
8686
diesel_migrations = { version = "1.0.0-beta1", features = ["postgres"] }
87+
88+
# Remove once cookie depends on ring >= 0.13.0
89+
[patch.crates-io]
90+
ring = { git = "https://github.com/SergioBenitez/ring", branch = "v0.11" }

0 commit comments

Comments
 (0)