parameters: toolchain: 'stable' os: 'Ubuntu' style: false jobs: - job: ${{ format('{0}_{1}_clippy_{2}', parameters.os, parameters.toolchain, parameters.style) }} ${{ if ne(parameters.style, 'true') }}: displayName: ${{ format('{0} with Rust {1}', parameters.os, parameters.toolchain) }} # 'vim oddity fix ${{ if eq(parameters.style, 'true') }}: displayName: ${{ format('Clippy + Rustfmt ({0} with Rust {1})', parameters.os, parameters.toolchain) }} variables: rustup_toolchain: ${{ parameters.toolchain }} pool: ${{ if eq(parameters.os, 'Ubuntu') }}: vmImage: 'ubuntu-16.04' ${{ if eq(parameters.os, 'Windows') }}: vmImage: 'vs2017-win2016' ${{ if eq(parameters.os, 'macOS') }}: vmImage: 'macos-10.13' steps: - ${{ if eq(parameters.os, 'Windows') }}: - script: | curl -sSf -o rustup-init.exe https://win.rustup.rs rustup-init.exe -y --default-toolchain %RUSTUP_TOOLCHAIN% echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin" displayName: Install Rust via exe - ${{ if ne(parameters.os, 'Windows') }}: - script: | curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin" displayName: Install Rust via Bash - ${{ if ne(parameters.style, 'true') }}: - script: cargo build --all displayName: Build - script: cargo test --all displayName: Tests - ${{ if eq(parameters.style, 'true') }}: - script: rustup component add clippy displayName: Install Clippy - script: cargo clippy --all -- -D clippy::all displayName: Clippy - script: rustup install nightly && rustup component add rustfmt --toolchain nightly displayName: Install Rustfmt - bash: cargo +nightly fmt --all -- --check && cd celeste_derive/ && cargo +nightly fmt --all -- --check displayName: Rustfmt ${{ if eq(parameters.toolchain, 'nightly') }}: continueOnError: true