Working on Azure pipelines
This commit is contained in:
parent
6a326d6a11
commit
15e2b82923
|
@ -18,40 +18,23 @@ strategy:
|
||||||
pool:
|
pool:
|
||||||
vmImage: $(imageName)
|
vmImage: $(imageName)
|
||||||
|
|
||||||
steps:
|
jobs:
|
||||||
# Install RUST
|
- job: Linux
|
||||||
|
pool:
|
||||||
|
vmImage: 'ubuntu-latest'
|
||||||
|
steps:
|
||||||
|
- template: ci/test.yml # Template reference
|
||||||
|
|
||||||
# Linux and macOS.
|
# - job: macOS
|
||||||
- script: |
|
# pool:
|
||||||
set -e
|
# vmImage: 'macOS-10.13'
|
||||||
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN
|
# steps:
|
||||||
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
|
# - template: templates/npm-steps.yml # Template reference
|
||||||
env:
|
#
|
||||||
RUSTUP_TOOLCHAIN: ${{parameters.rust_version}}
|
# - job: Windows
|
||||||
displayName: "Install rust (*nix)"
|
# pool:
|
||||||
condition: not(eq(variables['Agent.OS'], 'Windows_NT'))
|
# vmImage: 'vs2017-win2016'
|
||||||
# Windows.
|
# steps:
|
||||||
- script: |
|
# - script: echo This script runs before the template's steps, only on Windows.
|
||||||
curl -sSf -o rustup-init.exe https://win.rustup.rs
|
# - template: templates/npm-steps.yml # Template reference
|
||||||
rustup-init.exe -y --default-toolchain %RUSTUP_TOOLCHAIN%
|
# - script: echo This step runs after the template's steps.
|
||||||
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
|
|
35
ci/install-rust.yml
Normal file
35
ci/install-rust.yml
Normal 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
9
ci/test.yml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
parameters:
|
||||||
|
rust_version: stable
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- template: install-rust.yml
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
cargo test
|
||||||
|
displayName: cargo test
|
Loading…
Reference in New Issue
Block a user