# Documentation: https://aka.ms/yaml trigger: branches: include: - '*' exclude: - 'staging.tmp' strategy: matrix: linux: image_name: 'ubuntu-16.04' rustup_toolchain: stable mac: image_name: 'macos-10.13' rustup_toolchain: stable windows: image_name: 'vs2017-win2016' rustup_toolchain: stable pool: vmImage: $(image_name) steps: - bash: | echo "Hello world from $AGENT_NAME running on $AGENT_OS" echo "Reason: $BUILD_REASON" echo "Requested for: $BUILD_REQUESTEDFOR" displayName: 'Build Info' continueOnError: true - script: | curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin" condition: or(eq( variables['Agent.OS'], 'Linux' ), eq( variables['Agent.OS'], 'Darwin' )) displayName: 'Install Rust (Linux/macOS)' - 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 condition: eq( variables['Agent.OS'], 'Windows_NT' ) displayName: 'Install Rust (Windows)' - script: | rustc -Vv cargo -V displayName: 'Print Rust Version' continueOnError: true - script: rustup target add thumbv7em-none-eabihf displayName: Add thumbv7em-none-eabihf Target - script: cargo build --target thumbv7em-none-eabihf displayName: 'Build for thumbv7em-none-eabihf' - script: cargo rustc -- -C link-arg=-nostartfiles condition: eq( variables['Agent.OS'], 'Linux' ) displayName: 'Build for Linux' - script: cargo rustc -- -C link-args="-e __start -static -nostartfiles" condition: eq( variables['Agent.OS'], 'Darwin' ) displayName: 'Build for macOS' - script: cargo rustc -- -C link-args="/ENTRY:_start /SUBSYSTEM:console" condition: eq( variables['Agent.OS'], 'Windows_NT' ) displayName: 'Build for Windows' - script: rustup component add rustfmt displayName: 'Install Rustfmt' - script: cargo fmt -- --check displayName: 'Check Formatting'