From 55e860e8d4b04c8bcba38bb31582d36bb34a2556 Mon Sep 17 00:00:00 2001 From: Matt McCoy Date: Wed, 12 Jul 2017 17:05:32 -0400 Subject: [PATCH] Add a build for windows using appveyor (#37) --- .travis.yml | 14 ++++---- README.md | 1 + appveyor.yml | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 103 insertions(+), 6 deletions(-) create mode 100644 appveyor.yml diff --git a/.travis.yml b/.travis.yml index 0525bd2..b0aca60 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,13 @@ sudo: false language: rust +cache: cargo +# necessary for `travis-cargo coveralls --no-sudo` +addons: + apt: + packages: + - libcurl4-openssl-dev + - libelf-dev + - libdw-dev rust: - stable - beta @@ -13,12 +21,6 @@ script: travis-cargo test && travis-cargo bench && travis-cargo --only stable doc -addons: - apt: - packages: - - libcurl4-openssl-dev - - libelf-dev - - libdw-dev after_success: - travis-cargo --only stable doc-upload - travis-cargo coveralls --exclude-pattern=/target --no-sudo diff --git a/README.md b/README.md index 406a1d0..34de340 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ rust-imap IMAP Client for Rust [![Build Status](https://travis-ci.org/mattnenterprise/rust-imap.svg)](https://travis-ci.org/mattnenterprise/rust-imap) +[![Build Status](https://ci.appveyor.com/api/projects/status/github/mattnenterprise/rust-imap?svg=true)](https://ci.appveyor.com/api/projects/status/github/mattnenterprise/rust-imap) [![crates.io](http://meritbadge.herokuapp.com/imap)](https://crates.io/crates/imap) [![Coverage Status](https://coveralls.io/repos/github/mattnenterprise/rust-imap/badge.svg?branch=master)](https://coveralls.io/github/mattnenterprise/rust-imap?branch=master) diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..3ae2701 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,94 @@ +environment: + + global: + RUST_VERSION: stable + CRATE_NAME: imap + SSL_CERT_FILE: "C:\\OpenSSL\\cacert.pem" + + matrix: + + # MinGW + - TARGET: i686-pc-windows-gnu + BITS: 32 + MSYS2: 1 + OPENSSL_VERSION: 1_1_0f + - TARGET: x86_64-pc-windows-gnu + BITS: 64 + MSYS2: 1 + OPENSSL_VERSION: 1_0_2L + + # MSVC + - TARGET: i686-pc-windows-msvc + BITS: 32 + OPENSSL_VERSION: 1_0_2L + OPENSSL_DIR: C:\OpenSSL + - TARGET: x86_64-pc-windows-msvc + BITS: 64 + OPENSSL_VERSION: 1_1_0f + OPENSSL_DIR: C:\OpenSSL + + # MinGW beta + - TARGET: i686-pc-windows-gnu + BITS: 32 + MSYS2: 1 + OPENSSL_VERSION: 1_1_0f + RUST_VERSION: beta + - TARGET: x86_64-pc-windows-gnu + BITS: 64 + MSYS2: 1 + OPENSSL_VERSION: 1_0_2L + RUST_VERSION: beta + + # MSVC beta + - TARGET: i686-pc-windows-msvc + BITS: 32 + MSYS2: 1 + OPENSSL_VERSION: 1_0_2L + OPENSSL_DIR: C:\OpenSSL + RUST_VERSION: beta + - TARGET: x86_64-pc-windows-msvc + BITS: 64 + OPENSSL_VERSION: 1_1_0f + OPENSSL_DIR: C:\OpenSSL + RUST_VERSION: beta + +install: + # install OpenSSL + - ps: Start-FileDownload "http://slproweb.com/download/Win${env:BITS}OpenSSL-${env:OPENSSL_VERSION}.exe" + - Win%BITS%OpenSSL-%OPENSSL_VERSION%.exe /SILENT /VERYSILENT /SP- /DIR="C:\OpenSSL" + - appveyor DownloadFile https://curl.haxx.se/ca/cacert.pem -FileName C:\OpenSSL\cacert.pem + + # install Rust + - curl -sSf -o rustup-init.exe https://win.rustup.rs/ + - rustup-init.exe -y --default-host %TARGET% --default-toolchain %RUST_VERSION% + - set PATH=%PATH%;C:\Users\appveyor\.cargo\bin + - if defined MSYS2 set PATH=C:\msys64\mingw%BITS%\bin;%PATH% + - rustc -Vv + - cargo -V + + - curl -sSf -o rustup-init.exe https://win.rustup.rs/ + - rustup-init.exe -y --default-host %TARGET% + - set PATH=%PATH%;C:\Users\appveyor\.cargo\bin + - if defined MSYS2 set PATH=C:\msys64\mingw%BITS%\bin;%PATH% + - rustc -V + - cargo -V + +test_script: + # we don't run the "test phase" when doing deploys + - if [%APPVEYOR_REPO_TAG%]==[false] ( + cargo build --target %TARGET% && + cargo build --target %TARGET% --release && + cargo test --target %TARGET% && + cargo test --target %TARGET% --release + ) + +cache: + - C:\Users\appveyor\.cargo\registry + - target + +notifications: + - provider: Email + on_build_success: false + +# Building is done in the test phase, so we disable Appveyor's build phase. +build: false