Skip to content

Commit 2439a87

Browse files
committed
Use CI caching and cargo feature install-upgrade
* do not force to install rustfmt * use cargo-cache * disable bash trace * clone single branch
1 parent ddb5cb7 commit 2439a87

File tree

4 files changed

+20
-8
lines changed

4 files changed

+20
-8
lines changed

.github/deploy.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@ SSH_REPO=${REPO/https:\/\/github.com\//[email protected]:}
1313
SHA=$(git rev-parse --verify HEAD)
1414

1515
# Clone the existing gh-pages for this repo into out/
16-
(
17-
git clone "$REPO" out
18-
cd out
19-
git checkout $TARGET_BRANCH
20-
)
16+
git clone -q --single-branch --branch "$TARGET_BRANCH" "$REPO" out
2117

2218
echo "Removing the current docs for master"
2319
rm -rf out/master/ || exit 0

.travis.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,24 @@ branches:
1414
- trying.tmp
1515
- staging.tmp
1616

17+
cache:
18+
directories:
19+
- $HOME/.cargo
20+
before_cache:
21+
- cargo install -Z install-upgrade cargo-cache --debug
22+
- cargo cache --autoclean
23+
1724
env:
1825
global:
1926
- RUST_BACKTRACE=1
2027
- secure: "OKulfkA5OGd/d1IhvBKzRkHQwMcWjzrzbimo7+5NhkUkWxndAzl+719TB3wWvIh1i2wXXrEXsyZkXM5FtRrHm55v1VKQ5ibjEvFg1w3NIg81iDyoLq186fLqywvxGkOAFPrsePPsBj5USd5xvhwwbrjO6L7/RK6Z8shBwOSc41s="
2128

2229
install:
2330
- |
24-
if [ -z ${INTEGRATION} ]; then
25-
rustup component add rustfmt || cargo install --git https://github.com/rust-lang/rustfmt/ --force
31+
if [[ -z ${INTEGRATION} ]]; then
32+
if ! rustup component add rustfmt; then
33+
cargo install -Z install-upgrade --git https://github.com/rust-lang/rustfmt --bin rustfmt
34+
fi
2635
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
2736
. $HOME/.nvm/nvm.sh
2837
nvm install stable

appveyor.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,18 @@ branches:
1313
- auto
1414
- try
1515

16+
cache:
17+
- '%USERPROFILE%\.cargo'
18+
on_finish:
19+
- cargo install -Z install-upgrade cargo-cache --debug
20+
- cargo cache --autoclean
21+
1622
install:
1723
- curl -sSf -o rustup-init.exe https://win.rustup.rs/
1824
- rustup-init.exe -y --default-host %TARGET% --default-toolchain nightly
1925
- set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
2026
- del rust-toolchain
21-
- cargo install rustup-toolchain-install-master --debug || echo "rustup-toolchain-install-master already installed"
27+
- cargo install -Z install-upgrade rustup-toolchain-install-master --debug || echo "rustup-toolchain-install-master already installed"
2228
- rustup-toolchain-install-master -f -n master
2329
- rustup component add rustfmt --toolchain nightly & exit 0 # Format test handles missing rustfmt
2430
- rustup default master

setup-toolchain.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ cd "$(dirname "$0")" || exit
77

88
if ! command -v rustup-toolchain-install-master > /dev/null; then
99
cargo install \
10+
-Z install-upgrade \
1011
rustup-toolchain-install-master \
1112
--bin rustup-toolchain-install-master \
1213
--debug

0 commit comments

Comments
 (0)