140 lines (124 loc) · 4.09 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: Test pywinrm
on:
push:
branches:
- master
pull_request:
branches:
- master
# env:
# WINRM_USERNAME: pywinrm-test
# WINRM_PASSWORD: Password123!
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
python-version:
- 2.7
- 3.6
- 3.7
- 3.8
- 3.9
- '3.10'
- pypy-2.7
- pypy-3.7
arch:
- x86
- x64
exclude:
- os: macos-latest
arch: x86
- os: macos-latest
python-version: pypy-2.7
- os: macos-latest
python-version: pypy-3.7
- os: ubuntu-latest
arch: x86
- os: windows-latest
python-version: pypy-2.7
- os: windows-latest
python-version: pypy-3.7
steps:
- uses: actions/checkout@v2
- name: set up python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.arch }}
# - name: Remove extra modules to speed up PowerShell startup module due to slow WinRM issue
# if: startsWith(matrix.os, 'windows')
# shell: bash
# run: |
# rm -rf "/c/Program Files/WindowsPowerShell/Modules/AWSPowerShell"
# rm -rf "/c/Program Files/WindowsPowerShell/Modules/Microsoft.Graph*"
# - name: set up Windows integration tests
# if: startsWith(matrix.os, 'windows')
# shell: pwsh
# run: |
# Write-Host 'Create local admin user'
# $userParams = @{
# Name = $env:WINRM_USERNAME
# Password = (ConvertTo-SecureString -AsPlainText -Force -String $env:WINRM_PASSWORD)
# AccountNeverExpires = $true
# PasswordNeverExpires = $true
# }
# $null = New-LocalUser @userParams
# Add-LocalGroupMember -Group Administrators -Member $userParams.Name
# Write-Host 'Setting up WinRM settings'
# Enable-PSRemoting -Force -SkipNetworkProfileCheck
# Enable-WSManCredSSP -Role Server -Force
# Set-Item WSMan:\localhost\Service\Auth\Basic $true
# Set-Item WSMan:\localhost\Service\Auth\CredSSP $true
# Set-Item WSMan:\localhost\Service\AllowUnencrypted $true
- name: set up Linux dependencies
if: startsWith(matrix.os, 'ubuntu')
run: >-
sudo apt-get install -y
gcc
python-dev
libkrb5-dev
env:
DEBIAN_FRONTEND: noninteractive
- name: install dependencies
run: |
pip install coveralls
pip install .[credssp,kerberos]
pip install -r requirements-test.txt
- name: run test - non Windows
if: "!startsWith(matrix.os, 'windows')"
run: |
pytest -v --flake8 --cov=winrm --cov-report=term-missing winrm/tests/
- name: run test - Windows
if: startsWith(matrix.os, 'windows')
run: |
pytest -v --flake8 --cov=winrm --cov-report=term-missing winrm/tests/
# env:
# WINRM_TRANSPORT: basic
# WINRM_ENDPOINT: http://localhost:5985/wsman
- name: upload coverage data
if: "!endsWith(matrix.python-version, '2.7')" # Uses an older coverals version that doesn't support GHA
run: coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: run integration with NTLM
# if: startsWith(matrix.os, 'windows')
# run: |
# Set-Item WSMan:\localhost\Service\AllowUnencrypted $false
# py.test -v winrm/tests/test_integration_protocol.py winrm/tests/test_integration_session.py
# env:
# WINRM_TRANSPORT: ntlm
# WINRM_ENDPOINT: http://localhost:5985/wsman
# - name: run integration with CredSSP
# if: startsWith(matrix.os, 'windows')
# run: |
# Set-Item WSMan:\localhost\Service\AllowUnencrypted $false
# py.test -v winrm/tests/test_integration_protocol.py winrm/tests/test_integration_session.py
# env:
# WINRM_TRANSPORT: credssp
# WINRM_ENDPOINT: http://localhost:5985/wsman