Przeglądaj źródła

Add sample azure pipelines configuration

Alex Crichton 6 lat temu
rodzic
commit
ef099c7994
3 zmienionych plików z 68 dodań i 0 usunięć
  1. 33 0
      azure-pipelines.yml
  2. 25 0
      ci/azure-install-rust.yml
  3. 10 0
      ci/azure-steps.yml

+ 33 - 0
azure-pipelines.yml

@@ -0,0 +1,33 @@
+trigger:
+  - master
+
+jobs:
+  - job: Linux
+    pool:
+      vmImage: ubuntu-16.04
+    steps:
+      - template: ci/azure-steps.yml
+    strategy:
+      matrix:
+        aarch64-unknown-linux-gnu:
+          TARGET: aarch64-unknown-linux-gnu
+
+  - job: macOS
+    pool:
+      vmImage: macos-10.13
+    steps:
+      - template: ci/azure-steps.yml
+    strategy:
+      matrix:
+        x86_64-apple-darwin:
+          TARGET: x86_64-apple-darwin
+
+  - job: Windows
+    pool:
+      vmImage: 'vs2017-win2016'
+    steps:
+      - template: ci/azure-steps.yml
+    strategy:
+      matrix:
+        i686-pc-windows-msvc:
+          TARGET: i686-pc-windows-msvc

+ 25 - 0
ci/azure-install-rust.yml

@@ -0,0 +1,25 @@
+parameters:
+  toolchain: 'nightly'
+
+steps:
+  - bash: |
+      curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $TOOLCHAIN
+      echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
+    displayName: Install rust
+    condition: ne( variables['Agent.OS'], 'Windows_NT' )
+    env:
+      TOOLCHAIN: ${{ parameters.toolchain }}
+
+  - script: |
+      curl -sSf -o rustup-init.exe https://win.rustup.rs
+      rustup-init.exe -y --default-toolchain %TOOLCHAIN%
+      echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin"
+    displayName: Install rust
+    condition: eq( variables['Agent.OS'], 'Windows_NT' )
+    env:
+      TOOLCHAIN: ${{ parameters.toolchain }}
+
+  - script: |
+        rustc -Vv
+        cargo -V
+    displayName: Query rust and cargo versions

+ 10 - 0
ci/azure-steps.yml

@@ -0,0 +1,10 @@
+steps:
+  - template: azure-install-rust.yml
+
+  - bash: ./ci/run.sh $TARGET
+    condition: ne( variables['Agent.OS'], 'Linux' )
+    displayName: Run test script
+
+  - bash: ./ci/run-docker.sh $TARGET
+    condition: eq( variables['Agent.OS'], 'Linux' )
+    displayName: Run docker test script