diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f6ca091..d50e0c4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -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 \ No newline at end of file +# - 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. \ No newline at end of file diff --git a/ci/install-rust.yml b/ci/install-rust.yml new file mode 100644 index 0000000..ca9e2c4 --- /dev/null +++ b/ci/install-rust.yml @@ -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 \ No newline at end of file diff --git a/ci/test.yml b/ci/test.yml new file mode 100644 index 0000000..ba5d3f8 --- /dev/null +++ b/ci/test.yml @@ -0,0 +1,9 @@ +parameters: + rust_version: stable + +steps: + - template: install-rust.yml + + - script: | + cargo test + displayName: cargo test \ No newline at end of file