From 462b0b51491367d1fe5cf1b2d5a46c8f521c19e4 Mon Sep 17 00:00:00 2001 From: Syrus Date: Sat, 10 Aug 2019 11:11:54 -0700 Subject: [PATCH] Initial version of Azure pipelines --- .azure-pipelines.yml | 79 +++++++++++++++++++++++++++++++++++++++++ .azure/install-rust.yml | 40 +++++++++++++++++++++ .circleci/config.yml | 3 -- Makefile | 24 +++++++------ 4 files changed, 132 insertions(+), 14 deletions(-) create mode 100644 .azure-pipelines.yml create mode 100644 .azure/install-rust.yml diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml new file mode 100644 index 000000000..f377f977c --- /dev/null +++ b/.azure-pipelines.yml @@ -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: + - '*' + diff --git a/.azure/install-rust.yml b/.azure/install-rust.yml new file mode 100644 index 000000000..5c5915d0a --- /dev/null +++ b/.azure/install-rust.yml @@ -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 diff --git a/.circleci/config.yml b/.circleci/config.yml index 4a3b44588..67bcbbbc2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 diff --git a/Makefile b/Makefile index a12d14fe5..4fba50646 100644 --- a/Makefile +++ b/Makefile @@ -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