Rocket

A web framework for Rust. https://rocket.rs (mirror)
git clone git://git.thc420.xyz/Rocket
Log | Files | Refs | README

commit fe4fd3e2412df690249352480395ca9fa6db0124
parent 7f2c9f426cd88b6e09022954570c448cab6403f7
Author: Sergio Benitez <sb@sergio.bz>
Date:   Sat,  6 Jul 2019 00:58:38 -0700

Migrate from Travis to Azure Pipelines for CI.

Resolves #801.

Diffstat:
A.gitattributes | 1+
A.github/azure-pipelines-template.yml | 71+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.github/azure-pipelines.yml | 16++++++++++++++++
D.travis.yml | 12------------
MREADME.md | 10+++++++---
5 files changed, 95 insertions(+), 15 deletions(-)

diff --git a/.gitattributes b/.gitattributes @@ -0,0 +1 @@ +* text eol=lf diff --git a/.github/azure-pipelines-template.yml b/.github/azure-pipelines-template.yml @@ -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))' diff --git a/.github/azure-pipelines.yml b/.github/azure-pipelines.yml @@ -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 diff --git a/.travis.yml b/.travis.yml @@ -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 diff --git a/README.md b/README.md @@ -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) @@ -91,8 +91,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