mirror of
https://github.com/dalance/procs.git
synced 2026-10-12 02:12:39 +00:00
170 lines
5.7 KiB
YAML
170 lines
5.7 KiB
YAML
trigger:
|
|
branches:
|
|
include:
|
|
- '*'
|
|
tags:
|
|
include:
|
|
- '*'
|
|
|
|
resources:
|
|
containers:
|
|
- container: tarpaulin
|
|
image: xd009642/tarpaulin:latest-nightly
|
|
options: --security-opt seccomp=unconfined
|
|
|
|
jobs:
|
|
- job: Linux
|
|
pool:
|
|
vmImage: 'ubuntu-16.04'
|
|
steps:
|
|
- script: |
|
|
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable
|
|
echo '##vso[task.setvariable variable=PATH]$(PATH):$(HOME)/.cargo/bin'
|
|
displayName: Install rustup
|
|
|
|
- script: |
|
|
cargo install cargo2junit
|
|
rustup target add x86_64-unknown-linux-musl
|
|
sudo apt-get -qq install musl-tools
|
|
displayName: Install tools
|
|
|
|
- script: |
|
|
cargo test -- -Z unstable-options --format json | cargo2junit > results.xml
|
|
displayName: Run test
|
|
|
|
- task: PublishTestResults@2
|
|
inputs:
|
|
testResultsFormat: 'JUnit'
|
|
testResultsFiles: 'results.xml'
|
|
condition: succeededOrFailed()
|
|
|
|
- script: |
|
|
make release_lnx
|
|
cp *.zip $(Build.ArtifactStagingDirectory)
|
|
displayName: Build release binary
|
|
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
inputs:
|
|
artifactName: 'Linux'
|
|
pathtoPublish: $(Build.ArtifactStagingDirectory)
|
|
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
|
|
|
|
- job: macOS
|
|
pool:
|
|
vmImage: 'macos-10.13'
|
|
steps:
|
|
- script: |
|
|
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable
|
|
echo '##vso[task.setvariable variable=PATH]$(PATH):$(HOME)/.cargo/bin'
|
|
displayName: Install rustup
|
|
|
|
- script: |
|
|
cargo install cargo2junit
|
|
displayName: Install tools
|
|
|
|
- script: |
|
|
cargo test -- -Z unstable-options --format json | cargo2junit > results.xml
|
|
cargo build
|
|
sudo ./target/debug/procs --tree
|
|
displayName: Run test
|
|
|
|
- task: PublishTestResults@2
|
|
inputs:
|
|
testResultsFormat: 'JUnit'
|
|
testResultsFiles: 'results.xml'
|
|
condition: succeededOrFailed()
|
|
|
|
- script: |
|
|
make release_mac
|
|
cp *.zip $(Build.ArtifactStagingDirectory)
|
|
displayName: Build release binary
|
|
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
inputs:
|
|
artifactName: 'macOS'
|
|
pathtoPublish: $(Build.ArtifactStagingDirectory)
|
|
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
|
|
|
|
- job: Windows
|
|
pool:
|
|
vmImage: 'vs2017-win2016'
|
|
steps:
|
|
- script: |
|
|
curl -sSf -o rustup-init.exe https://win.rustup.rs
|
|
rustup-init.exe -y --default-toolchain stable
|
|
set PATH=%PATH%;%USERPROFILE%\.cargo\bin
|
|
echo '##vso[task.setvariable variable=PATH]%PATH%;%USERPROFILE%\.cargo\bin'
|
|
displayName: Install rustup
|
|
|
|
- script: |
|
|
cargo install cargo2junit
|
|
displayName: Install tools
|
|
|
|
- script: |
|
|
cargo test -- -Z unstable-options --format json | cargo2junit > results.xml
|
|
displayName: Run test
|
|
|
|
- task: PublishTestResults@2
|
|
inputs:
|
|
testResultsFormat: 'JUnit'
|
|
testResultsFiles: 'results.xml'
|
|
condition: succeededOrFailed()
|
|
|
|
- script: |
|
|
make release_win
|
|
cp *.zip $(Build.ArtifactStagingDirectory)
|
|
displayName: Build release binary
|
|
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
inputs:
|
|
artifactName: 'Windows'
|
|
pathtoPublish: $(Build.ArtifactStagingDirectory)
|
|
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
|
|
|
|
- job: Coverage
|
|
pool:
|
|
vmImage: 'ubuntu-16.04'
|
|
container: tarpaulin
|
|
steps:
|
|
- script: |
|
|
cargo tarpaulin -v --out Xml
|
|
curl -s https://codecov.io/bash -o .codecov && chmod +x .codecov
|
|
./.codecov -B "${BUILD_SOURCEBRANCHNAME:-}" \
|
|
-C "${BUILD_SOURCEVERSION:-}" \
|
|
-P "${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER:-}" \
|
|
-b "${BUILD_BUILDID:-}" \
|
|
-K -n "report name"
|
|
displayName: Run tarpaulin
|
|
env:
|
|
CODECOV_TOKEN: $(CODECOV_TOKEN)
|
|
|
|
- job: Release
|
|
dependsOn:
|
|
- Linux
|
|
- macOS
|
|
- Windows
|
|
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
|
|
steps:
|
|
- task: DownloadBuildArtifacts@0
|
|
inputs:
|
|
downloadType: 'specific'
|
|
itemPattern: '**'
|
|
downloadPath: $(Build.ArtifactStagingDirectory)
|
|
|
|
- task: GitHubRelease@0
|
|
inputs:
|
|
gitHubConnection: 'dalance'
|
|
repositoryName: 'dalance/procs'
|
|
tagSource: 'auto'
|
|
releaseNotesSource: 'input'
|
|
releaseNotes: '[Changelog](https://github.com/dalance/procs/blob/master/CHANGELOG.md)'
|
|
assets: '$(Build.ArtifactStagingDirectory)/*/*'
|
|
assetUploadMode: 'replace'
|
|
isDraft: false
|
|
isPreRelease: false
|
|
addChangeLog: false
|
|
displayName: Release to GitHub
|