mirror of
https://github.com/chmln/sd
synced 2024-11-22 11:13:04 +00:00
azure pipelines - take 1
This commit is contained in:
parent
193e5ed158
commit
0fd9fc477e
2 changed files with 62 additions and 0 deletions
39
.ci/azure-pipelines.yml
Normal file
39
.ci/azure-pipelines.yml
Normal 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
23
.ci/template.yml
Normal 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/
|
Loading…
Reference in a new issue