1# Appveyor configuration template for Rust using rustup for Rust installation
2# https://github.com/starkat99/appveyor-rust
3
4## Operating System (VM environment) ##
5
6# Rust needs at least Visual Studio 2013 Appveyor OS for MSVC targets.
7os: Visual Studio 2017
8
9## Build Matrix ##
10
11# This configuration will setup a build for each channel & target combination (12 windows
12# combinations in all).
13#
14# There are 3 channels: stable, beta, and nightly.
15#
16# Alternatively, the full version may be specified for the channel to build using that specific
17# version (e.g. channel: 1.5.0)
18#
19# The values for target are the set of windows Rust build targets. Each value is of the form
20#
21# ARCH-pc-windows-TOOLCHAIN
22#
23# Where ARCH is the target architecture, either x86_64 or i686, and TOOLCHAIN is the linker
24# toolchain to use, either msvc or gnu. See https://www.rust-lang.org/downloads.html#win-foot for
25# a description of the toolchain differences.
26# See https://github.com/rust-lang-nursery/rustup.rs/#toolchain-specification for description of
27# toolchains and host triples.
28#
29# Comment out channel/target combos you do not wish to build in CI.
30#
31# You may use the `cargoflags` and `RUSTFLAGS` variables to set additional flags for cargo commands
32# and rustc, respectively. For instance, you can uncomment the cargoflags lines in the nightly
33# channels to enable unstable features when building for nightly. Or you could add additional
34# matrix entries to test different combinations of features.
35environment:
36  matrix:
37
38### MSVC Toolchains ###
39
40  # Stable 64-bit MSVC
41    - channel: stable
42      target: x86_64-pc-windows-msvc
43  # Stable 32-bit MSVC
44    - channel: stable
45      target: i686-pc-windows-msvc
46  # Beta 64-bit MSVC
47    - channel: beta
48      target: x86_64-pc-windows-msvc
49  # Beta 32-bit MSVC
50    - channel: beta
51      target: i686-pc-windows-msvc
52  # Nightly 64-bit MSVC
53    - channel: nightly
54      target: x86_64-pc-windows-msvc
55  # Nightly 32-bit MSVC
56    - channel: nightly
57      target: i686-pc-windows-msvc
58
59### GNU Toolchains ###
60
61  # Stable 64-bit GNU
62    - channel: stable
63      target: x86_64-pc-windows-gnu
64  # Stable 32-bit GNU
65    - channel: stable
66      target: i686-pc-windows-gnu
67  # Beta 64-bit GNU
68    - channel: beta
69      target: x86_64-pc-windows-gnu
70  # Beta 32-bit GNU
71    - channel: beta
72      target: i686-pc-windows-gnu
73  # Nightly 64-bit GNU
74    - channel: nightly
75      target: x86_64-pc-windows-gnu
76  # Nightly 32-bit GNU
77    - channel: nightly
78      target: i686-pc-windows-gnu
79
80### Allowed failures ###
81
82# See Appveyor documentation for specific details. In short, place any channel or targets you wish
83# to allow build failures on (usually nightly at least is a wise choice). This will prevent a build
84# or test failure in the matching channels/targets from failing the entire build.
85#matrix:
86#  allow_failures:
87#    - channel: nightly
88
89# If you only care about stable channel build failures, uncomment the following line:
90    #- channel: beta
91
92## Install Script ##
93
94# This is the most important part of the Appveyor configuration. This installs the version of Rust
95# specified by the 'channel' and 'target' environment variables from the build matrix. This uses
96# rustup to install Rust.
97#
98# For simple configurations, instead of using the build matrix, you can simply set the
99# default-toolchain and default-host manually here.
100install:
101  - appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
102  - rustup-init -yv --default-toolchain %channel% --default-host %target%
103  - set PATH=%PATH%;%USERPROFILE%\.cargo\bin
104  - rustc -vV
105  - cargo -vV
106
107## Build Script ##
108
109# 'cargo test' takes care of building for us, so disable Appveyor's build stage. This prevents
110# the "directory does not contain a project or solution file" error.
111build: false
112
113# Uses 'cargo test' to run tests and build. Alternatively, the project may call compiled programs
114#directly or perform other testing commands. Rust will automatically be placed in the PATH
115# environment variable.
116test_script:
117  - cargo test --verbose
118