]> git.lizzy.rs Git - rust.git/blobdiff - appveyor.yml
Auto merge of #4318 - izik1:typo, r=phansch
[rust.git] / appveyor.yml
index 9db787cf41ec9805eec5b61d42bd5db246d775f0..092a5c80a8eb4103b7098e531ec80d19708bf04b 100644 (file)
@@ -7,13 +7,22 @@ environment:
         #- TARGET: x86_64-pc-windows-gnu
         - TARGET: x86_64-pc-windows-msvc
 
+branches:
+    # Only build AppVeyor on r+ and try branch
+    only:
+      - auto
+      - try
+
 install:
-    - del rust-toolchain
     - curl -sSf -o rustup-init.exe https://win.rustup.rs/
     - rustup-init.exe -y --default-host %TARGET% --default-toolchain nightly
-    - set PATH=%PATH%;C:\Users\appveyor\.cargo\bin;C:\Users\appveyor\.rustup\toolchains\nightly-%TARGET%\bin
-    - cargo install rustup-toolchain-install-master || echo "rustup-toolchain-install-master already installed"
-    - rustup-toolchain-install-master -f -n master
+    - set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
+    - git ls-remote https://github.com/rust-lang/rust.git master | awk '{print $1}' >rustc-hash.txt
+    - set /p RUSTC_HASH=<rustc-hash.txt
+    - del rust-toolchain
+    - cargo install rustup-toolchain-install-master --debug || echo "rustup-toolchain-install-master already installed"
+    - rustup-toolchain-install-master %RUSTC_HASH% -f -n master
+    - rustup component add rustfmt --toolchain nightly || echo "rustfmt nightly is unavailable"
     - rustup default master
     - set PATH=%PATH%;C:\Users\appveyor\.rustup\toolchains\master\bin
     - rustc -V