AppVeyor

AppVeyor is a CI service for Linux and Windows. It's also free for open source projects and provides good integration with GitHub. To start using this service, you have to add an appveyor.yml file to your project. Let's look at the example configuration:

os: Visual Studio 2015
environment:
matrix:
- channel: stable
target: x86_64-pc-windows-msvc
- channel: nightly
target: i686-pc-windows-msvc
- channel: stable
target: x86_64-pc-windows-gnu
- channel: nightly
target: i686-pc-windows-gnu

The configuration looks similar to the configuration for TravisCI. We also created a matrix of builds and will use MSVC and GNU toolchains for stable and nightly compiler versions. After this, we use these values to install the required tools using rustup:

install:
- appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
- rustup-init -yv --default-toolchain %channel% --default-host %target%
- set PATH=%PATH%;%USERPROFILE%.cargoin
- rustup component add rustfmt
- rustup component add clippy
- rustc -vV
- cargo -vV

We also installed the rustfmt and clippy tools after the PATH environment variable was updated. Finally, we can build the projects as follows:

build: false
test_script:
- cargo fmt -- --check
- cargo clippy
- cargo build
- cargo test

We set the build field to false to prevent the building agent from starting the MSBuild tool, which is not necessary for Rust crates.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.177.86