From 6d07a311bd7d2bc47297ff8242d109ede95764fe Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Tue, 5 Feb 2019 14:50:33 +0100 Subject: [PATCH 1/4] Add CI script for azure pipelines --- azure-pipelines.yml | 51 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 00000000..fa355b07 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,51 @@ +# Documentation: https://aka.ms/yaml + +trigger: + batch: true + branches: + include: + # This is where pull requests from "bors r+" are built. + - staging + # This is where pull requests from "bors try" are built. + - trying + # Build pull requests. + - master + # Build post braches + - post-* + +strategy: + matrix: + linux: + image_name: 'ubuntu-16.04' + rustup_toolchain: nightly + +pool: + vmImage: $(image_name) + +steps: +- bash: | + echo "Hello world from $AGENT_NAME running on $AGENT_OS" + echo "Reason: $BUILD_REASON" + case "$BUILD_REASON" in + "Manual") echo "$BUILD_REQUESTEDFOR manually queued the build." ;; + "PullRequest") echo "This is a CI build for a pull request on $BUILD_REQUESTEDFOR." ;; + "IndividualCI") echo "This is a CI build for $BUILD_REQUESTEDFOR." ;; + "BatchedCI") echo "This is a batched CI build for $BUILD_REQUESTEDFOR." ;; + *) "$BUILD_REASON" ;; + esac + displayName: 'Build Info' + continueOnError: true + +- script: | + curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN + echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin" + displayName: 'Install Rust' + +- script: | + rustc -Vv + cargo -V + displayName: 'Print Rust Version' + continueOnError: true + +- script: cargo rustc -- -Z pre-link-arg=-nostartfiles + displayName: 'Build' From 57484164ab43a0943536db97bef967913feb65bc Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Tue, 5 Feb 2019 14:55:22 +0100 Subject: [PATCH 2/4] Expand azure pipelines script for second post --- azure-pipelines.yml | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index fa355b07..11196962 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -18,6 +18,12 @@ strategy: linux: image_name: 'ubuntu-16.04' rustup_toolchain: nightly + mac: + image_name: 'macos-10.13' + rustup_toolchain: nightly + windows: + image_name: 'vs2017-win2016' + rustup_toolchain: nightly pool: vmImage: $(image_name) @@ -39,7 +45,15 @@ steps: - script: | curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin" - displayName: 'Install Rust' + condition: or(eq( variables['Agent.OS'], 'Linux' ), eq( variables['Agent.OS'], 'Darwin' )) + displayName: 'Install Rust (Linux/macOS)' + +- script: | + curl -sSf -o rustup-init.exe https://win.rustup.rs + rustup-init.exe -y --default-toolchain %RUSTUP_TOOLCHAIN% + echo ##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin + condition: eq( variables['Agent.OS'], 'Windows_NT' ) + displayName: 'Install Rust (Windows)' - script: | rustc -Vv @@ -47,5 +61,13 @@ steps: displayName: 'Print Rust Version' continueOnError: true -- script: cargo rustc -- -Z pre-link-arg=-nostartfiles +- script: rustup component add rust-src + displayName: 'Install Rustup Src Component' + +- script: | + cargo install cargo-xbuild --debug + cargo install bootimage --debug + displayName: 'Install cargo-xbuild and bootimage' + +- script: bootimage build displayName: 'Build' From b71e0644bf0bec2a21e6de4f3ad70938607fa1d6 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Tue, 5 Feb 2019 14:57:46 +0100 Subject: [PATCH 3/4] Update azure pipelines script for unit testing post --- azure-pipelines.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 11196962..0e3484c6 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -71,3 +71,6 @@ steps: - script: bootimage build displayName: 'Build' + +- script: cargo test + displayName: 'Unit Tests' From f15bbaea3f76d491c913af84629eb0bfc8568bf4 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Tue, 5 Feb 2019 14:58:51 +0100 Subject: [PATCH 4/4] Update azure pipelines script for integration tests --- azure-pipelines.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0e3484c6..0e948ce1 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -74,3 +74,26 @@ steps: - script: cargo test displayName: 'Unit Tests' + +- script: sudo apt install qemu-system-x86 + condition: eq( variables['Agent.OS'], 'Linux' ) + displayName: 'Install QEMU (Linux)' + +- script: | + export HOMEBREW_NO_AUTO_UPDATE=1 + export HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK=1 + export HOMEBREW_NO_INSTALL_CLEANUP=1 + brew install qemu + condition: eq( variables['Agent.OS'], 'Darwin' ) + displayName: 'Install QEMU (macOS)' + +- script: | + choco install qemu --limit-output --no-progress + echo ##vso[task.setvariable variable=PATH;]%PATH%;C:\Program Files\qemu + set PATH=%PATH%;C:\Program Files\qemu + qemu-system-x86_64 --version + condition: eq( variables['Agent.OS'], 'Windows_NT' ) + displayName: 'Install QEMU (Windows)' + +- script: bootimage test + displayName: 'Integration Tests'