From 851f2e53234e6167388a4bcc8e418d676d61d383 Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Fri, 21 Sep 2018 12:53:04 -0500 Subject: [PATCH] fix AppVeyor CI configuration --- .appveyor.yml | 112 ++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 85 insertions(+), 27 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index bcf2fecae..2cbfe4016 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,58 +1,116 @@ +version: "{build} ~ {branch}" + +branches: + except: + - gh-pages + os: Visual Studio 2015 +matrix: + allow_failures: + - CHANNEL: nightly + environment: + global: + FEATURES: "generic" matrix: - - TARGET: x86_64-pc-windows-msvc - MSYS_BITS: 64 + - CHANNEL: 1.27.0 + ARCH: i686 TOOLCHAIN: msvc - PLATFORM: x86_64 - - TARGET: i686-pc-windows-msvc - MSYS_BITS: 32 + - CHANNEL: stable + ARCH: i686 TOOLCHAIN: msvc - PLATFORM: i686 - - TARGET: i686-pc-windows-gnu + - CHANNEL: stable + ARCH: x86_64 + TOOLCHAIN: msvc +# - CHANNEL: beta +# ARCH: i686 +# TOOLCHAIN: msvc +# - CHANNEL: beta +# ARCH: x86_64 +# TOOLCHAIN: msvc + - CHANNEL: nightly + ARCH: i686 + TOOLCHAIN: msvc + - CHANNEL: nightly + ARCH: x86_64 + TOOLCHAIN: msvc + - CHANNEL: stable + ARCH: i686 + TOOLCHAIN: gnu + - CHANNEL: stable + ARCH: x86_64 + TOOLCHAIN: gnu +# - CHANNEL: beta +# ARCH: i686 +# TOOLCHAIN: gnu +# - CHANNEL: beta +# ARCH: x86_64 +# TOOLCHAIN: gnu + - CHANNEL: nightly + ARCH: i686 + TOOLCHAIN: gnu + - CHANNEL: nightly + ARCH: x86_64 + TOOLCHAIN: gnu + - CHANNEL: stable + ARCH: i686 + TOOLCHAIN: gnu MINGW_URL: https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/4.9.2/threads-win32/dwarf/i686-4.9.2-release-win32-dwarf-rt_v4-rev4.7z/download MINGW_ARCHIVE: i686-4.9.2-release-win32-dwarf-rt_v4-rev4.7z MINGW_DIR: mingw32 DIR_TEMP_MINGW: C:\cached\mingw - - TARGET: x86_64-pc-windows-gnu - MSYS_BITS: 64 install: - - SET PATH=%PATH%;C:\Program Files (x86)\Rust\bin;C:\MinGW\bin + # force branch checkout (if knowable), then reset to the specific commit ## (can be needed for accurate code coverage info) + # * this allows later apps to see the branch name using standard `git branch` operations, yet always builds the correct specific commit + # * ref: [`@`](https://archive.is/RVpnF) + - if DEFINED APPVEYOR_REPO_BRANCH if /I "%APPVEYOR_REPO_SCM%"=="git" ( git checkout "%APPVEYOR_REPO_BRANCH%" & git reset --hard "%APPVEYOR_REPO_COMMIT%" ) + # ensure CWD is project main directory + - cd "%APPVEYOR_BUILD_FOLDER%" + # create a working area + - ps: if ( ! $env:CI_TEMP_DIR ) { $env:CI_TEMP_DIR = "${env:TEMP}\${env:APPVEYOR_JOB_ID}" ; mkdir -force $env:CI_TEMP_DIR | out-null } + - set "TARGET=%ARCH%-pc-windows-%TOOLCHAIN%" + # install `rust` via `rustup` + - call appveyor DownloadFile "https://win.rustup.rs/" -FileName "%CI_TEMP_DIR%\rustup-init.exe" + - call "%CI_TEMP_DIR%\\rustup-init.exe" -y --default-toolchain %CHANNEL% --default-host %TARGET% --no-modify-path + - set "PATH=%PATH%;%USERPROFILE%\.cargo\bin" + - rustc -vV + - cargo -vV - # Use the system msys if we can + # finalize FEATURES + - if /I "%CHANNEL%"=="nightly" set "FEATURES=nightly %FEATURES%" + + # "gnu" toolchain setup + - if /I "%TOOLCHAIN%"=="gnu" set "PATH=%PATH%;C:\MinGW\bin" + # * use the system MSYS if we can + - if /I "%TOOLCHAIN%"=="gnu" if /I "%ARCH%"=="i686" set "MSYS_BITS=32" + - if /I "%TOOLCHAIN%"=="gnu" if /I "%ARCH%"=="x86_64" set "MSYS_BITS=64" - if defined MSYS_BITS set PATH=C:\msys64\mingw%MSYS_BITS%\bin;C:\msys64\usr\bin;%PATH% - - - ps: >- - Start-FileDownload "https://static.rust-lang.org/dist/rust-nightly-${env:TARGET}.exe"; + # * specific MinGW, if specified + - ps: | if ((Test-Path Env:\MINGW_ARCHIVE) -and -not (Test-Path "${env:DIR_TEMP_MINGW}\${env:MINGW_ARCHIVE}")) { if (Test-Path "${env:DIR_TEMP_MINGW}") { rm -Recurse ${env:DIR_TEMP_MINGW}\*; } New-Item -ItemType Directory -Force -Path ${env:DIR_TEMP_MINGW} | Out-Null; $download_loc = ${env:MINGW_URL}; - Start-FileDownload $download_loc -FileName "${env:DIR_TEMP_MINGW}\${env:MINGW_ARCHIVE}"; + appveyor DownloadFile $download_loc -FileName "${env:DIR_TEMP_MINGW}\${env:MINGW_ARCHIVE}"; } - if defined MINGW_ARCHIVE 7z x -y "%DIR_TEMP_MINGW%\%MINGW_ARCHIVE%" > nul - if defined MINGW_ARCHIVE set PATH=%CD%\%MINGW_DIR%\bin;C:\msys64\usr\bin;%PATH% - - rust-nightly-%TARGET%.exe /VERYSILENT /NORESTART /DIR="C:\Program Files (x86)\Rust" - - - rustc -V - - cargo -V - - if "%TOOLCHAIN%" == "msvc" if "%PLATFORM%" == "i686" call "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" - - if "%TOOLCHAIN%" == "msvc" if "%PLATFORM%" == "x86_64" "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 - - if "%TOOLCHAIN%" == "msvc" if "%PLATFORM%" == "x86_64" call "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64 + # "msvc" toolchain setup + - if "%TOOLCHAIN%" == "msvc" if "%ARCH%" == "i686" call "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" + - if "%TOOLCHAIN%" == "msvc" if "%ARCH%" == "x86_64" "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 + - if "%TOOLCHAIN%" == "msvc" if "%ARCH%" == "x86_64" call "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64 artifacts: - path: target\debug\uutils.exe name: uutils.exe -build: false +build_script: + - cargo build --features "%FEATURES%" --no-default-features test_script: - - cargo test --no-fail-fast --features "nightly generic" --no-default-features - -cache: - - c:\cached + - cargo test --no-fail-fast --features "%FEATURES%" --no-default-features