steps:
- task: NodeTool@0
  inputs:
    versionSpec: "16.x"

- task: UsePythonVersion@0
  inputs:
    versionSpec: '3.x'
    addToPath: true

- powershell: |
    $env:npm_config_arch="$(VSCODE_ARCH)"
    yarn
  displayName: Install Dependencies

- powershell: |
    yarn prepublish
  displayName: Build

- powershell: |
    yarn test
  displayName: Run Tests
  condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'))

- script: |
    curl -sSf -o rustup-init.exe https://win.rustup.rs
    rustup-init.exe -y --profile minimal
    set PATH=%PATH%;%USERPROFILE%\.cargo\bin
    echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin"
  displayName: Install Rust

- script: cargo test --features vendored-openssl
  displayName: Test Rust Bindings
  workingDirectory: rs

- script: cargo test --features vendored-openssl
  displayName: Test Rust Native
  workingDirectory: rs-pure
