summaryrefslogtreecommitdiffstats
path: root/ci
diff options
context:
space:
mode:
authorMatan Kushner <hello@matchai.me>2019-05-16 09:40:30 -0600
committerGitHub <noreply@github.com>2019-05-16 09:40:30 -0600
commit2cf69a82b7fcb4d61c853f54488e0b02d301033e (patch)
treed84889473d6bfe3f5b014c8afc945f918cda916b /ci
parent90d6e6cf0b22520a5177e8e842acbb142482e4eb (diff)
ci: Fix CI to work with changes to Azure Pipelines build agent (#55)
Diffstat (limited to 'ci')
-rw-r--r--ci/azure-install-rust.yml25
-rw-r--r--ci/azure-rustfmt.yml16
-rw-r--r--ci/azure-setup-test-env.yml16
-rw-r--r--ci/azure-test-nightly.yml13
-rw-r--r--ci/azure-test-stable.yml23
5 files changed, 93 insertions, 0 deletions
diff --git a/ci/azure-install-rust.yml b/ci/azure-install-rust.yml
new file mode 100644
index 000000000..122e8a981
--- /dev/null
+++ b/ci/azure-install-rust.yml
@@ -0,0 +1,25 @@
+steps:
+ # Linux and macOS
+ - script: |
+ set -e
+ curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN
+ echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin:/usr/local/cargo/bin"
+ env:
+ RUSTUP_TOOLCHAIN: ${{parameters.rust_version}}
+ displayName: "Install rust (*nix)"
+ condition: not(eq(variables['Agent.OS'], 'Windows_NT'))
+ # Windows
+ - script: |
+ curl -sSf -o rustup-init.exe https://win.rustup.rs
+ rustup-init.exe -y --default-toolchain %RUSTUP_TOOLCHAIN%
+ set PATH=%PATH%;%USERPROFILE%\.cargo\bin
+ echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin"
+ env:
+ RUSTUP_TOOLCHAIN: ${{parameters.rust_version}}
+ displayName: "Install rust (windows)"
+ condition: eq(variables['Agent.OS'], 'Windows_NT')
+ # All platforms.
+ - script: |
+ rustc -Vv
+ cargo -V
+ displayName: Query rust and cargo versions
diff --git a/ci/azure-rustfmt.yml b/ci/azure-rustfmt.yml
new file mode 100644
index 000000000..60bb51aa5
--- /dev/null
+++ b/ci/azure-rustfmt.yml
@@ -0,0 +1,16 @@
+jobs:
+# Check formatting
+- job: ${{ parameters.name }}
+ displayName: Check rustfmt
+ pool:
+ vmImage: ubuntu-16.04
+ steps:
+ - template: azure-install-rust.yml
+ parameters:
+ rust_version: stable
+ - script: |
+ rustup component add rustfmt
+ displayName: Install rustfmt
+ - script: |
+ cargo fmt --all -- --check
+ displayName: Check formatting
diff --git a/ci/azure-setup-test-env.yml b/ci/azure-setup-test-env.yml
new file mode 100644
index 000000000..c2c54b078
--- /dev/null
+++ b/ci/azure-setup-test-env.yml
@@ -0,0 +1,16 @@
+steps:
+ # Install Node.js
+ - task: NodeTool@0
+ inputs:
+ versionSpec: "12.0.0"
+ displayName: "Install a fixed version of Node"
+ # Install Go
+ - task: GoTool@0
+ inputs:
+ versionSpec: "1.10"
+ displayName: "Install a fixed version of Go"
+ # Install Python
+ - task: UsePythonVersion@0
+ inputs:
+ versionSpec: "3.6.8"
+ displayName: "Install a fixed version of Python"
diff --git a/ci/azure-test-nightly.yml b/ci/azure-test-nightly.yml
new file mode 100644
index 000000000..e6f507881
--- /dev/null
+++ b/ci/azure-test-nightly.yml
@@ -0,0 +1,13 @@
+jobs:
+- job: ${{ parameters.name }}
+ displayName: ${{ parameters.displayName }}
+ pool:
+ vmImage: ubuntu-16.04
+
+ steps:
+ - template: azure-install-rust.yml
+ parameters:
+ rust_version: nightly
+
+ - script: cargo check --all
+ displayName: cargo +nightly check --all
diff --git a/ci/azure-test-stable.yml b/ci/azure-test-stable.yml
new file mode 100644
index 000000000..031b69399
--- /dev/null
+++ b/ci/azure-test-stable.yml
@@ -0,0 +1,23 @@
+jobs:
+- job: ${{ parameters.name }}
+ displayName: ${{ parameters.displayName }}
+ strategy:
+ matrix:
+ Linux:
+ vmImage: ubuntu-16.04
+ MacOS:
+ vmImage: macOS-10.13
+ Windows:
+ vmImage: vs2017-win2016
+ pool:
+ vmImage: $(vmImage)
+
+ steps:
+ - template: azure-install-rust.yml
+ parameters:
+ rust_version: stable
+
+ - template: azure-setup-test-env.yml
+
+ - script: cargo test -- --ignored
+ displayName: cargo test