Working on Azure pipelines

This commit is contained in:
Federico Terzi 2019-09-21 11:05:57 +02:00
parent 6a326d6a11
commit 15e2b82923
3 changed files with 63 additions and 36 deletions

View File

@ -18,40 +18,23 @@ strategy:
pool:
vmImage: $(imageName)
steps:
# Install RUST
jobs:
- job: Linux
pool:
vmImage: 'ubuntu-latest'
steps:
- template: ci/test.yml # Template reference
# Linux and macOS.
- script: |
set -e
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
env:
RUSTUP_TOOLCHAIN: ${{parameters.rust_version}}
displayName: "Install rust (*nix)"
condition: not(eq(variables['Agent.OS'], 'Windows_NT'))
# Windows.
- script: |
curl -sSf -o rustup-init.exe https://win.rustup.rs
rustup-init.exe -y --default-toolchain %RUSTUP_TOOLCHAIN%
set PATH=%PATH%;%USERPROFILE%\.cargo\bin
echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin"
env:
RUSTUP_TOOLCHAIN: ${{parameters.rust_version}}
displayName: "Install rust (windows)"
condition: eq(variables['Agent.OS'], 'Windows_NT')
# All platforms.
- script: |
rustup -V
rustup component list --installed
rustc -Vv
cargo -V
displayName: Query rust and cargo versions
# Build espanso
- script: |
cargo build --release
displayName: Building espanso
# - job: macOS
# pool:
# vmImage: 'macOS-10.13'
# steps:
# - template: templates/npm-steps.yml # Template reference
#
# - job: Windows
# pool:
# vmImage: 'vs2017-win2016'
# steps:
# - script: echo This script runs before the template's steps, only on Windows.
# - template: templates/npm-steps.yml # Template reference
# - script: echo This step runs after the template's steps.

35
ci/install-rust.yml Normal file
View File

@ -0,0 +1,35 @@
# defaults for any parameters that aren't specified
parameters:
rust_version: stable
steps:
# Linux and macOS.
- script: |
set -e
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
env:
RUSTUP_TOOLCHAIN: ${{parameters.rust_version}}
displayName: "Install rust (*nix)"
condition: not(eq(variables['Agent.OS'], 'Windows_NT'))
# Windows.
- script: |
curl -sSf -o rustup-init.exe https://win.rustup.rs
rustup-init.exe -y --default-toolchain %RUSTUP_TOOLCHAIN%
set PATH=%PATH%;%USERPROFILE%\.cargo\bin
echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin"
env:
RUSTUP_TOOLCHAIN: ${{parameters.rust_version}}
displayName: "Install rust (windows)"
condition: eq(variables['Agent.OS'], 'Windows_NT')
# Install additional components:
- ${{ each component in parameters.components }}:
- script: rustup component add ${{ component }}
# All platforms.
- script: |
rustup -V
rustup component list --installed
rustc -Vv
cargo -V
displayName: Query rust and cargo versions

9
ci/test.yml Normal file
View File

@ -0,0 +1,9 @@
parameters:
rust_version: stable
steps:
- template: install-rust.yml
- script: |
cargo test
displayName: cargo test