Codebase list pypsrp / 5a5a1314-7dae-4b56-87ce-2ee4753e81bb/main appveyor.yml
5a5a1314-7dae-4b56-87ce-2ee4753e81bb/main

Tree @5a5a1314-7dae-4b56-87ce-2ee4753e81bb/main (Download .tar.gz)

appveyor.yml @5a5a1314-7dae-4b56-87ce-2ee4753e81bb/mainraw · history · blame

# Windows Server 2016
image: Visual Studio 2017

environment:
  global:
    # SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
    # /E:ON and /V:ON options are not enabled in the batch script intepreter
    # See: http://stackoverflow.com/a/13751649/163740
    WITH_COMPILER: "cmd /E:ON /V:ON /C .\\build-scripts\\run_with_compiler.cmd"
    PYPSRP_SERVER: 127.0.0.1
    PYPSRP_AUTH: negotiate
    # used as part of unit tests
    PYPSRP_PORT: 5985

    # used as part of the integration tests which tests both http and https
    PYPSRP_HTTP_PORT: 5985
    PYPSRP_HTTPS_PORT: 5986
  matrix:
  # https://www.appveyor.com/docs/installed-software/#python
  - PYTHON: Python27
  - PYTHON: Python27-x64
  - PYTHON: Python34
  - PYTHON: Python34-x64
  - PYTHON: Python35
  - PYTHON: Python35-x64
  - PYTHON: Python36
  - PYTHON: Python36-x64
  - PYTHON: Python37
  - PYTHON: Python37-x64

init:
- ps: |
    # Override default Python version/architecture
    $env:Path="C:\$env:PYTHON;C:\$env:PYTHON\Scripts;$env:PATH"
    python -c "import platform; print('Python', platform.python_version(), platform.architecture()[0])"

    $env:PYPSRP_USERNAME = $($env:USERNAME)
    $env:PYPSRP_PASSWORD = [Microsoft.Win32.Registry]::GetValue("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultPassword", '')
    $env:PYPSRP_CERT_DIR = Join-Path -Path $env:USERPROFILE -ChildPath Documents
    $env:PYPSRP_RUN_INTEGRATION = 1

install:
- ps: |
    powershell.exe -File "$pwd\appveyor\setup.ps1" -ResetWinRM -Name $env:PYPSRP_USERNAME -JEAConfigPath "$pwd\appveyor" -InformationAction Continue
    # make sure JEA settings are loaded
    Register-PSSessionConfiguration -Path "$pwd\appveyor\JEARoleSettings.pssc" -Name JEARole -Force

    # need to add the cert mapping after registering the JEA role
    $sec_pass = ConvertTo-SecureString -String $env:PYPSRP_PASSWORD -AsPlainText -Force
    $credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $env:PYPSRP_USERNAME, $sec_pass
    $thumbprint = (Get-ChildItem -Path Cert:\LocalMachine\TrustedPeople)[0].Thumbprint

    New-Item -Path WSMan:\localhost\ClientCertificate `
        -Subject "$($env:PYPSRP_USERNAME)@localhost" `
        -URI * `
        -Issuer $thumbprint `
        -Credential $credential `
        -Force

    Restart-Service -Name winrm
- cmd: python -m pip install --upgrade pip
- cmd: pip install --upgrade setuptools
- cmd: pip install -r requirements-test.txt -c tests\constraints.txt
- cmd: pip install .[credssp] -c tests\constraints.txt

# test out pywin32 on some matrixes
- ps: |
    $ErrorActionPreference = "SilentlyContinue"
    if ($env:PYTHON -in @("Python27", "Python27-x64", "Python36", "Python36-x64")) {
        pip install .[kerberos]
    }
    $ErrorActionPreference = "Stop"

build: off  # Do not run MSBuild, build stuff at install step

test_script:
- cmd: py.test -v --instafail --pep8 --cov pypsrp --cov-report term-missing