azure pipelines - take 1

This commit is contained in:
Greg 2019-03-02 22:17:44 -05:00
parent 193e5ed158
commit 0fd9fc477e
No known key found for this signature in database
GPG key ID: 2E44FAEEDC94B1E2
2 changed files with 62 additions and 0 deletions

39
.ci/azure-pipelines.yml Normal file
View file

@ -0,0 +1,39 @@
trigger:
batch: true
branches:
include: [master] # branch names which will trigger a build
pr:
autoCancel: true
branches:
include: [master]
jobs:
- job: test
displayName: Typecheck & test
pool:
vmImage: ubuntu-16.04
steps:
- script: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
displayName: Install Rust stable
- script: |
cd binary
cargo check
displayName: cargo check
- script: |
cd binary
cargo test
displayName: cargo test
- template: .ci/template.yml
parameters:
name: Linux
vmImage: ubuntu-16.04
target: x86_64-unknown-linux-gnu
- template: .ci/template.yml
parameters:
name: macOS
vmImage: macOS-10.13
target: x86_64-apple-darwin

23
.ci/template.yml Normal file
View file

@ -0,0 +1,23 @@
jobs:
- job: ${{ parameters.name }}
condition: eq(variables['build.sourceBranch'], 'refs/heads/master')
dependsOn: test
condition: succeeded()
pool:
vmImage: ${{ parameters.vmImage }}
steps:
#- script: |
# curl https://sh.rustup.rs -sSf | sh -s -- -y
# echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
# displayName: Install Rust
- ${{ if eq(parameters.name, 'Linux') }}:
- script: cargo build --release --target=${{ parameters.target }}
displayName: Build binary
- script: |
mkdir release
mv target/${{ parameters.target }}/release/sd release/linux-x64
displayName: Package binary
- task: PublishPipelineArtifact@0
inputs:
artifactName: Binary for ${{ parameters.name }}
targetPath: release/