Migrate from Travis to Azure Pipelines for CI.

Resolves #801.
This commit is contained in:
Sergio Benitez 2019-07-06 00:58:38 -07:00
parent 35753c4d53
commit bc7d9bac7c
5 changed files with 95 additions and 15 deletions

1
.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
* text eol=lf

71
.github/azure-pipelines-template.yml vendored Normal file
View File

@ -0,0 +1,71 @@
jobs:
- job: ${{ parameters.name }}
pool:
vmImage: ${{ parameters.vmImage }}
strategy:
matrix:
debug:
test_flag: ""
test_kind: Debug
rust_version: nightly
release:
test_flag: "--release"
test_kind: Release
rust_version: nightly
contrib:
test_flag: "--contrib"
test_kind: Contrib
rust_version: nightly
maxParallel: 3
steps:
# maxOS native dependency installation
- ${{ if eq(parameters.name, 'macOS') }}:
- script: brew install mysql-connector-c libpq sqlite coreutils
displayName: 'Install Native Dependencies'
# Linux native dependency installation
- ${{ if eq(parameters.name, 'Linux') }}:
- script: |
sudo apt-get update
sudo apt-get install -y libmariadb-client-lgpl-dev-compat libpq-dev libsqlite3-dev
displayName: 'Install Native Dependencies'
# Windows native dependency installation
# vcpkg --triplet x64-windows install libmysql libpq sqlite3 openssl
# + vcpkg/installed/vcpkg (in particular, the status file)
- ${{ if eq(parameters.name, 'Windows') }}:
- script: |
curl -fsS -o vcpkg.7z https://rocket.rs/static/vcpkg-2019-07-05.7z
7z x vcpkg.7z -y -bb0
xcopy .\vcpkg %VCPKG_INSTALLATION_ROOT% /s /e /h /y /q
vcpkg integrate install
echo ##vso[task.setvariable variable=VCPKGRS_DYNAMIC]1
echo ##vso[task.setvariable variable=PATH]%PATH%;%VCPKG_INSTALLATION_ROOT%\installed\x64-windows\lib
echo ##vso[task.setvariable variable=VCPKG_ROOT]%VCPKG_INSTALLATION_ROOT%
displayName: "Install Native Dependencies"
# Unix Rust installation
- ${{ if ne(parameters.name, 'Windows') }}:
- script: |
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $(rust_version)
echo "##vso[task.setvariable variable=PATH]$PATH:$HOME/.cargo/bin"
displayName: 'Install Rust ($(rust_version))'
# Windows Rust installation
- ${{ if eq(parameters.name, 'Windows') }}:
- script: |
curl -sSf -o rustup-init.exe https://win.rustup.rs
rustup-init.exe -y --default-toolchain $(rust_version)
echo ##vso[task.setvariable variable=PATH]%PATH%;%USERPROFILE%\.cargo\bin
displayName: 'Install Rust ($(rust_version))'
# Sanity check version information.
- script: |
rustup default $(rust_version)
rustc -Vv && cargo -V
displayName: 'Rust/Cargo Version Information'
# Run Rocket testing script(s)
- script: bash scripts/test.sh $(test_flag)
displayName: 'Unit Tests ($(test_kind))'

16
.github/azure-pipelines.yml vendored Normal file
View File

@ -0,0 +1,16 @@
name: Rocket
jobs:
- template: azure-pipelines-template.yml
parameters:
name: macOS
vmImage: macOS-10.14
- template: azure-pipelines-template.yml
parameters:
name: Linux
vmImage: ubuntu-16.04
- template: azure-pipelines-template.yml
parameters:
name: Windows
vmImage: windows-2019

View File

@ -1,12 +0,0 @@
language: rust
sudo: required # so we get a VM with higher specs
dist: trusty # so we get a VM with higher specs
cache: false
env:
- TEST_FLAGS=
- TEST_FLAGS=--release
- TEST_FLAGS=--contrib
- TEST_FLAGS=--core
rust:
- nightly
script: ./scripts/test.sh $TEST_FLAGS

View File

@ -1,6 +1,6 @@
# Rocket
[![Build Status](https://travis-ci.org/SergioBenitez/Rocket.svg?branch=master)](https://travis-ci.org/SergioBenitez/Rocket)
[![Build Status](https://dev.azure.com/SergioBenitez/Rocket/_apis/build/status/SergioBenitez.Rocket-Azure%20(1)?branchName=master)](https://dev.azure.com/SergioBenitez/Rocket/_build/latest?definitionId=2&branchName=master)
[![Rocket Homepage](https://img.shields.io/badge/web-rocket.rs-red.svg?style=flat&label=https&colorB=d33847)](https://rocket.rs)
[![Current Crates.io Version](https://img.shields.io/crates/v/rocket.svg)](https://crates.io/crates/rocket)
[![Chat on Matrix](https://img.shields.io/badge/style-matrix-blue.svg?style=flat&label=chat)](https://riot.im/app/#/room/#mozilla_#rocket:matrix.org)
@ -90,8 +90,12 @@ You should see `Hello, world!` by visiting `http://localhost:8000`.
To test Rocket, simply run `./scripts/test.sh` from the root of the source tree.
This will build and test the `core`, `codegen`, and `contrib` libraries as well
as all of the examples. This is the script that gets run by Travis CI. To test a
crate individually, run `cargo test --all-features`.
as all of the examples. The `test.sh` script accepts no flags or either the
`--release` flag to test in release mode or the `--contrib` flag to test all
`contrib` modules individually. This script gets run by CI.
To test a crate individually, run `cargo test --all-features` in the
corresponding crate directory.
### Core