Rocket/.github/azure-pipelines-template.yml

72 lines
2.5 KiB
YAML
Raw Normal View History

jobs:
- job: ${{ parameters.name }}
pool:
vmImage: ${{ parameters.vmImage }}
strategy:
matrix:
debug:
test_flag: ""
test_kind: Debug
rust_version: nightly
release:
test_flag: "--release"
test_kind: Release
rust_version: nightly
contrib:
test_flag: "--contrib"
test_kind: Contrib
rust_version: nightly
maxParallel: 3
steps:
# maxOS native dependency installation
- ${{ if eq(parameters.name, 'macOS') }}:
- script: brew install mysql-connector-c libpq sqlite coreutils
displayName: 'Install Native Dependencies'
# Linux native dependency installation
- ${{ if eq(parameters.name, 'Linux') }}:
- script: |
sudo apt-get update
sudo apt-get install -y libmariadb-client-lgpl-dev-compat libpq-dev libsqlite3-dev
displayName: 'Install Native Dependencies'
# Windows native dependency installation
# vcpkg --triplet x64-windows install libmysql libpq sqlite3 openssl
# + vcpkg/installed/vcpkg (in particular, the status file)
- ${{ if eq(parameters.name, 'Windows') }}:
- script: |
curl -fsS -o vcpkg.7z https://rocket.rs/static/vcpkg-2019-07-05.7z
7z x vcpkg.7z -y -bb0
xcopy .\vcpkg %VCPKG_INSTALLATION_ROOT% /s /e /h /y /q
vcpkg integrate install
echo ##vso[task.setvariable variable=VCPKGRS_DYNAMIC]1
echo ##vso[task.setvariable variable=PATH]%PATH%;%VCPKG_INSTALLATION_ROOT%\installed\x64-windows\lib
echo ##vso[task.setvariable variable=VCPKG_ROOT]%VCPKG_INSTALLATION_ROOT%
displayName: "Install Native Dependencies"
# Unix Rust installation
- ${{ if ne(parameters.name, 'Windows') }}:
- script: |
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $(rust_version)
echo "##vso[task.setvariable variable=PATH]$PATH:$HOME/.cargo/bin"
displayName: 'Install Rust ($(rust_version))'
# Windows Rust installation
- ${{ if eq(parameters.name, 'Windows') }}:
- script: |
curl -sSf -o rustup-init.exe https://win.rustup.rs
rustup-init.exe -y --default-toolchain $(rust_version)
echo ##vso[task.setvariable variable=PATH]%PATH%;%USERPROFILE%\.cargo\bin
displayName: 'Install Rust ($(rust_version))'
# Sanity check version information.
- script: |
rustup default $(rust_version)
rustc -Vv && cargo -V
displayName: 'Rust/Cargo Version Information'
# Run Rocket testing script(s)
- script: bash scripts/test.sh $(test_flag)
displayName: 'Unit Tests ($(test_kind))'