sd/azure-pipelines.yml

86 lines
1.9 KiB
YAML

trigger:
branches:
include: ['*']
tags:
include: ['*']
resources:
repositories:
- repository: templates
type: github
name: xoac/rust-azure-pipelines
ref: refs/tags/v0.0.2
endpoint: githubConnection
jobs:
# Check formatting
- template: ci/rustfmt.yml@templates
parameters:
name: rustfmt
displayName: Check formatting
rust_version: nightly
# This represents the minimum Rust version supported.
# Tests are not run as tests may require newer versions of rust.
- template: ci/cargo-check.yml@templates
parameters:
name: minrust
rust_version: 1.31.0 # The 2018 edition
displayName: Check rust min ver
################
# Test stage #
###############
# Test stable
- template: ci/test.yml@templates
parameters:
name: cargo_test_stable
displayName: Cargo test
cross: true # Test on Windows and macOS
# Test nightly
- template: ci/test.yml@templates
parameters:
name: cargo_test_nightly
displayName: Cargo test
rust_version: nightly
# Test cross
# List of supported targets is available here: https://github.com/rust-embedded/cross#supported-targets
- template: ci/cargo-cross.yml@templates
parameters:
name: cargo_cross
displayName: Cross check and test
rust_version: stable
test_targets:
- x86_64-unknown-linux-musl
###################
# DEPLOY PART #
###################
# Release binary
- template: ci/github-release.yml@templates
parameters:
name: github_release
dependsOn:
- minrust
- cargo_test_stable
- cargo_cross
rust_version: stable
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
contents: |
*
!*.rlib
!*.d
!.*
targets:
- x86_64-unknown-linux-gnu
- x86_64-pc-windows-gnu
- x86_64-pc-windows-msvc
- x86_64-apple-darwin
github:
gitHubConnection: githubConnection
repositoryName: chmln/sd