more arm testing of process.architecture #45
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# V0.1 | |
name: Pytest | |
on: [push, workflow_dispatch] | |
# Allows you to run this workflow manually from the Actions tab | |
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: | |
# Not a real dependency : but starting tests when ctypes generation is broken is not useful | |
if: false # Disable during ARM64 CI 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 | |
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 capstone-windows | |
# Testing | |
- name: Testing | |
run: py -${{ matrix.python-version}}-${{ matrix.python-bitness-to-test}} -m pytest --junitxml=junit/test-results.xml -s -k "not known_to_fail" -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 | |
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: Testing PFW execute | |
run: py -${{ matrix.python-version}}-${{ matrix.python-bitness-to-test}} -m pytest tests -k test_print_syswow_state -v -x -s |