Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
147 lines (125 sloc) 5.17 KB
---
phases:
- phase: Windows
queue: Hosted VS2017
steps:
- powershell: |
Write-Host "##vso[build.updatebuildnumber]v0.0.2.$env:BUILD_BUILDID"
displayName: Label Build
- powershell: |
invoke-restmethod -usebasicparsing 'https://static.rust-lang.org/rustup/dist/i686-pc-windows-gnu/rustup-init.exe' -outfile 'rustup-init.exe'
./rustup-init.exe -y --default-toolchain stable-x86_64-pc-windows-msvc --no-modify-path
& "$env:USERPROFILE/.cargo/bin/rustup.exe" install nightly-x86_64-pc-windows-msvc
remove-item rustup-init.exe
displayName: Install Rust
- powershell: |
& "$env:USERPROFILE/.cargo/bin/cargo.exe" +nightly-x86_64-pc-windows-msvc install rustfmt-nightly --force
& "$env:USERPROFILE/.cargo/bin/cargo.exe" +nightly-x86_64-pc-windows-msvc fmt -- --write-mode diff
displayName: Validate Formatting
- powershell: |
& "$env:USERPROFILE/.cargo/bin/cargo.exe" +stable-x86_64-pc-windows-msvc check
displayName: Cargo Check
- powershell: |
& "$env:USERPROFILE/.cargo/bin/cargo.exe" +stable-x86_64-pc-windows-msvc test
displayName: Run Tests
- powershell: |
& "$env:USERPROFILE/.cargo/bin/cargo.exe" +stable-x86_64-pc-windows-msvc build --release
displayName: Build Release
-
task: PublishBuildArtifacts@1
displayName: "Publish Artifact: Release Build"
inputs:
PathtoPublish: ./target/release/j2y.exe
ArtifactName: drop
ArtifactType: Container
TargetPath: "\\\\my\\share\\$(Build.DefinitionName)\\$(Build.BuildNumber)"
Parallel: "false"
ParallelCount: "8"
- phase: Linux
dependsOn: Windows
queue: Hosted Linux Preview
steps:
- script: |
export PATH="~/.cargo/bin:$PATH"
if command -v rustup >/dev/null; then
rustup install stable-x86_64-unknown-linux-gnu
else
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable-x86_64-unknown-linux-gnu -y
fi
rustup install nightly-x86_64-unknown-linux-gnu
displayName: Install Rust
- script: |
export PATH="~/.cargo/bin:$PATH"
cargo +nightly-x86_64-unknown-linux-gnu install rustfmt-nightly --force
cargo +nightly-x86_64-unknown-linux-gnu fmt -- --write-mode diff
displayName: Validate Formatting
- script: |
export PATH="~/.cargo/bin:$PATH"
cargo +nightly-x86_64-unknown-linux-gnu install rustfmt-nightly --force
cargo +nightly-x86_64-unknown-linux-gnu fmt -- --write-mode diff
displayName: Cargo Check
- script: |
export PATH="~/.cargo/bin:$PATH"
cargo +nightly-x86_64-unknown-linux-gnu test
displayName: Run Tests
- script: |
export PATH="~/.cargo/bin:$PATH"
cargo +nightly-x86_64-unknown-linux-gnu build --release
displayName: Build Release
- script: |
mv ./target/release/j2y ./target/release/j2y-linux
displayName: Rename Executable
-
task: PublishBuildArtifacts@1
displayName: "Publish Artifact: Release Build"
inputs:
PathtoPublish: ./target/release/j2y-linux
ArtifactName: drop
ArtifactType: Container
TargetPath: "\\\\my\\share\\$(Build.DefinitionName)\\$(Build.BuildNumber)"
Parallel: "false"
ParallelCount: "8"
- phase: Mac
dependsOn: Linux
queue: Hosted MacOS Preview
steps:
- script: |
export PATH="~/.cargo/bin:$PATH"
if command -v rustup >/dev/null; then
rustup install stable-x86_64-apple-darwin
else
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable-x86_64-apple-darwin -y
fi
rustup install nightly-x86_64-apple-darwin
displayName: Install Rust
- script: |
export PATH="~/.cargo/bin:$PATH"
cargo +nightly-x86_64-apple-darwin install rustfmt-nightly --force
cargo +nightly-x86_64-apple-darwin fmt -- --write-mode diff
displayName: Validate Formatting
- script: |
export PATH="~/.cargo/bin:$PATH"
cargo +nightly-x86_64-apple-darwin install rustfmt-nightly --force
cargo +nightly-x86_64-apple-darwin fmt -- --write-mode diff
displayName: Cargo Check
- script: |
export PATH="~/.cargo/bin:$PATH"
cargo +nightly-x86_64-apple-darwin test
displayName: Run Tests
- script: |
export PATH="~/.cargo/bin:$PATH"
cargo +nightly-x86_64-apple-darwin build --release
displayName: Build Release
- script: |
mv ./target/release/j2y ./target/release/j2y-darwin
displayName: Rename Executable
-
task: PublishBuildArtifacts@1
displayName: "Publish Artifact: Release Build"
inputs:
PathtoPublish: ./target/release/j2y-darwin
ArtifactName: drop
ArtifactType: Container
TargetPath: "\\\\my\\share\\$(Build.DefinitionName)\\$(Build.BuildNumber)"
Parallel: "false"
ParallelCount: "8"