Initial version of Azure pipelines

This commit is contained in:
Syrus 2019-08-10 11:11:54 -07:00
parent d23e5eb18c
commit 462b0b5149
4 changed files with 132 additions and 14 deletions

79
.azure-pipelines.yml Normal file
View File

@ -0,0 +1,79 @@
name: $(Build.SourceBranch)-$(date:yyyyMMdd)$(rev:.r)
# The Different jobs (lint, test, build to run)
jobs:
- job: lint
pool:
vmImage: 'ubuntu-16.04'
steps:
- checkout: self
submodules: true
- template: .azure/install-rust.yml
- displayName: Lint dependencies
script: |
rustup component add rustfmt
rustup component add clippy || cargo install --git https://github.com/rust-lang/rust-clippy/ --force clippy
- displayName: Lint
script: cargo fmt --all -- --check
variables:
rust_toolchain: stable
- job: Test
strategy:
matrix:
linux:
imageName: 'ubuntu-16.04'
mac:
imageName: 'macos-10.14'
windows:
imageName: 'vs2017-win2016'
variables:
rust_toolchain: nightly-2019-06-10
pool:
vmImage: $(imageName)
steps:
- checkout: self
submodules: true
- template: .azure/install-rust.yml
- displayName: Check with Flags
bash: make check
- displayName: Tests
bash: make test
- displayName: Integration Tests
bash: make integration-tests
# - job: Build
# strategy:
# matrix:
# linux:
# imageName: 'ubuntu-16.04'
# mac:
# imageName: 'macos-10.14'
# MACOSX_DEPLOYMENT_TARGET: 10.10
# windows:
# imageName: 'vs2017-win2016'
# RUSTFLAGS: -Ctarget-feature=+crt-static
# variables:
# rust_toolchain: nightly-2019-06-10
# pool:
# vmImage: $(imageName)
# steps:
# - checkout: self
# submodules: true
# - template: .azure/install-rust.yml
# - displayName: Tests
# bash: make test
trigger:
branches:
include:
- '*'

40
.azure/install-rust.yml Normal file
View File

@ -0,0 +1,40 @@
# This template installs Rust (if doesn't exist in the systems)
# Also installs the desired Rust toolchain
# Template inspired by Tokio and wasm-bindgen templates
# Tokio template: https://github.com/tokio-rs/tokio/blob/master/ci/azure-install-rust.yml
# Wasm-bindgen template: https://github.com/rustwasm/wasm-bindgen/blob/master/ci/azure-install-rust.yml
steps:
# Install Rust in Linux, Macos
- displayName: "Install Rust (Linux, macOS)"
script: |
set -ex
if [ -x "`command -v rustup`" ]; then
echo `command -v rustup` `rustup -V` installed
else
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUST_TOOLCHAIN
echo "##vso[task.prependpath]$HOME/.cargo/bin"
fi
condition: not(eq(variables['Agent.OS'], 'Windows_NT'))
- displayName: "Install Rust (Windows)"
script: |
set -ex
if [ -x "`command -v rustup`" ]; then
echo `command -v rustup` `rustup -V` installed
else
curl -sSf -o rustup-init.exe https://win.rustup.rs
./rustup-init.exe -y --default-toolchain $RUST_TOOLCHAIN
echo "##vso[task.prependpath]$USERPROFILE/.cargo/bin"
fi
condition: eq(variables['Agent.OS'], 'Windows_NT')
- displayName: Install Rust
bash: |
set -ex
rustup update $RUST_TOOLCHAIN
rustup default $RUST_TOOLCHAIN
rustc -Vv
cargo -V

View File

@ -112,9 +112,6 @@ jobs:
name: Check
command: |
make check
make compile-bench-singlepass
make compile-bench-llvm
# TODO: add compile-bench-clif when it works
- run:
name: Integration Tests
command: make integration-tests

View File

@ -127,9 +127,20 @@ debug:
install:
cargo install --path .
check:
cargo check --release --features backend-singlepass,backend-llvm,loader-kernel
# Checks
check-bench-singlepass:
cargo bench --all --no-run --no-default-features --features "backend-singlepass"
check-bench-clif:
cargo bench --all --no-run --no-default-features --features "backend-cranelift"
check-bench-llvm:
cargo bench --all --no-run --no-default-features --features "backend-llvm"
check-bench: check-bench-singlepass check-bench-llvm
check: check-bench
cargo check --release --features backend-singlepass,backend-llvm,loader-kernel,debug
# Release
release:
cargo build --release --features backend-singlepass,backend-llvm,loader-kernel
@ -152,15 +163,6 @@ bench-clif:
bench-llvm:
cargo bench --all --no-default-features --features "backend-llvm"
# compile but don't run the benchmarks
compile-bench-singlepass:
cargo bench --all --no-run --no-default-features --features "backend-singlepass"
compile-bench-clif:
cargo bench --all --no-run --no-default-features --features "backend-cranelift"
compile-bench-llvm:
cargo bench --all --no-run --no-default-features --features "backend-llvm"
# Build utils
build-install:
mkdir -p ./install/bin