servo: Merge #10340 - Appveyor: Cancel unnecessary builds on 'auto' branch (from UK992:win32); r=larsbergstrom
authorUK992 <urbankrajnc92@gmail.com>
Sat, 02 Apr 2016 03:19:03 +0500
changeset 338384 729ff86b053ff04d197067887c26fdcbe76e1297
parent 338383 fb6b6a657543480dfb6157732bfd6ad2b9a6f599
child 338385 d6fb6115f3f8d364822ec1d424eebf6ecda89ec7
push id31307
push usergszorc@mozilla.com
push dateSat, 04 Feb 2017 00:59:06 +0000
treeherdermozilla-central@94079d43835f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslarsbergstrom
servo: Merge #10340 - Appveyor: Cancel unnecessary builds on 'auto' branch (from UK992:win32); r=larsbergstrom This simple script will cancel build on ```auto``` branch if same commit already exist in ```master```. As a part of solution mentioned in https://github.com/servo/servo/issues/9953 Tested: Commit on master: [Appveyor/1.0.300](https://ci.appveyor.com/project/UK992/servo-hga0y/build/1.0.300) Same commit on auto: [Appveyor/1.0.302](https://ci.appveyor.com/project/UK992/servo-hga0y/build/1.0.301) Different commit on auto: [Appveyor/1.0.302](https://ci.appveyor.com/project/UK992/servo-hga0y/build/1.0.302) r? @larsbergstrom Source-Repo: https://github.com/servo/servo Source-Revision: 5333f564cd2f97ad78d2edc53f3791461b4b9244
servo/appveyor.yml
--- a/servo/appveyor.yml
+++ b/servo/appveyor.yml
@@ -13,16 +13,21 @@ branches:
 platform:
   - x64
 
 cache:
   - .servo
   - .cargo
 
 install:
+    # Check if commit in auto branch exists in master, if exists build will be canceled.
+  - cmd: >-
+      for /f %%i in ('git branch -r origin/master --contain %APPVEYOR_REPO_COMMIT%') do set git_status=%%i
+
+      IF %APPVEYOR_REPO_BRANCH%==auto (IF [%git_status%]==[origin/master] EXIT -1)
   - bash -lc "echo $MSYSTEM; pacman --needed --noconfirm -Sy pacman-mirrors"
   - bash -lc "pacman --noconfirm -Sy"
   - bash -lc "pacman -Sy --needed --noconfirm git mingw-w64-x86_64-toolchain mingw-w64-x86_64-freetype mingw-w64-x86_64-icu mingw-w64-x86_64-nspr mingw-w64-x86_64-ca-certificates mingw-w64-x86_64-expat mingw-w64-x86_64-cmake tar diffutils patch patchutils make python2-setuptools"
   - bash -lc "easy_install-2.7 pip virtualenv"
   - bash -lc "mv /mingw64/bin/python2.exe /mingw64/bin/python2-mingw64.exe"
   - bash -lc "mv /mingw64/bin/python2.7.exe /mingw64/bin/python2.7-mingw64.exe"
 
 # Uncomment these lines to expose RDP access information to the build machine in the build log.
@@ -31,13 +36,11 @@ install:
 #
 #on_finish:
 #  - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
 
 build_script:
   - cmd: >-
       set MSYSTEM=MINGW64
 
-      PATH C:\msys64\mingw64\bin;C:\msys64\usr\bin\;%PATH%
-
       bash -lc "cd $APPVEYOR_BUILD_FOLDER; ./mach build -d -v && ./mach test-unit"
 
 test: off