-
Notifications
You must be signed in to change notification settings - Fork 117
128 lines (116 loc) · 4.5 KB
/
tests.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
name: Pytest
on:
push:
branches:
- 'master'
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
generate_ctypes:
runs-on: windows-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- run:
py .\ctypes_generation\generate.py
- name: Check generated code can execute
run: py -c "import windows.generated_def"
tests:
strategy:
fail-fast: false
matrix:
runs-on: [windows-2019, windows-latest]
python-version: [2.7, 3.6, 3.11]
python-architecture: [x86, x64]
include:
# Translate architecture to bitness for py.exe commandline
- python-bitness-to-test: 32
python-architecture: x86
- python-bitness-to-test: 64
python-architecture: x64
# Not a real dependency : but starting tests when ctypes generation is broken is not useful
needs: generate_ctypes
timeout-minutes: 15
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v4
# Pfw testing need both 32b & 64b of tested python version for cross-bitness python injection tests
## Install the 32bits version of python3 asked
- name: Set up Python3 ${{ matrix.python-version }} x86
if: ${{ matrix.python-version != '2.7' }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version}}
architecture: x86
update-environment: false
## Install the 64bits version of python3 asked
- name: Set up Python3 ${{ matrix.python-version }} x64
if: ${{ matrix.python-version != '2.7' }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version}}
architecture: x64
update-environment: false
# Manually install python2.7 (both version at once)
- name: Set up Python2.7 ${{ matrix.python-version }} x86 & x64
shell: bash
if: ${{ matrix.python-version == '2.7' }}
run: |
choco install python2 --version=2.7.18 -y --no-progress --params '"/InstallDir:C:\tools\python27"'
choco install python2 --version=2.7.18 -y --no-progress -x86 --params '"/InstallDir:C:\tools\python2732"' --force
- name: Listing python versions availables
run: py -0
# Install PythonForWindows for both bitness
- name: Installing PythonForWindows for both bitness
run: |
py -${{ matrix.python-version}}-32 setup.py install
py -${{ matrix.python-version}}-64 setup.py install
- name: Installing pytest & capstone-windows
run: py -${{ matrix.python-version}}-${{ matrix.python-bitness-to-test}} -m pip install pytest pytest-timeout capstone-windows
# Testing
- name: Testing
run: py -${{ matrix.python-version}}-${{ matrix.python-bitness-to-test}} -m pytest --junitxml=junit/test-results.xml -s -v tests/
- name: Publish PyTest Results
uses: EnricoMi/publish-unit-test-result-action/windows@v2
if: always()
with:
files: junit/test-results.xml
check_name: PyTest Results for ${{ matrix.python-version}}-${{ matrix.python-bitness-to-test}}
secondary_rate_limit_wait_seconds: 90
seconds_between_github_writes: 10
seconds_between_github_reads: 1
# tests_arm64:
# needs: generate_ctypes
# timeout-minutes: 15
# runs-on: windows-ARM64
# continue-on-error: true
#
# strategy:
# fail-fast: false
# matrix:
# python-version: [3.11]
# python-architecture: [x86, x64, arm64]
# include:
# # Translate architecture to bitness for py.exe commandline
# - python-bitness-to-test: 32
# python-architecture: x86
# - python-bitness-to-test: 64
# python-architecture: x64
# - python-bitness-to-test: arm64
# python-architecture: arm64
#
# steps:
# - uses: actions/checkout@v4
#
# - name: Listing python versions availables
# run: py -0
#
# - name: Testing PFW execute
# run: py -${{ matrix.python-version}}-${{ matrix.python-bitness-to-test}} -c "import windows; print(windows)"
#
# - name: Arm64 pytests
# run: py -${{ matrix.python-version}}-${{ matrix.python-bitness-to-test}} -m pytest tests -k "not test_debugger" -v -s -r fEsx