Add github CI to test .\ctypes_generation\generate.py #146
Workflow file for this run
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: | |
build: | |
runs-on: windows-latest | |
timeout-minutes: 15 | |
strategy: | |
fail-fast: false | |
matrix: | |
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 | |
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 |