run CI #171
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
on: | |
pull_request: | |
branches: [main] | |
push: | |
branches: [main] | |
jobs: | |
unit-tests: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [windows-latest] | |
# python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] | |
# architecture: ['x86', 'x64'] | |
# npsupport: ['with npsupport', 'without npsupport'] | |
python-version: ['3.11'] | |
architecture: ['x64'] | |
npsupport: ['with npsupport'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: ${{ matrix.architecture }} | |
- name: Set up MSVC | |
uses: ilammy/msvc-dev-cmd@v1 | |
- name: Build and register the OutProc COM server | |
run: | | |
cd source/CppTestSrv | |
nmake /f Makefile | |
./server.exe /RegServer | |
- name: unittest comtypes | |
run: | | |
if ("${{ matrix.npsupport }}" -eq "with npsupport") { | |
pip install 'numpy<2' | |
} | |
pip install coverage | |
python -m coverage run -m unittest discover -v -s ./comtypes/test -t comtypes\test | |
# - name: Archive gen directory | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: gen-dir-${{ matrix.python-version }}-${{ matrix.architecture }}-${{ matrix.os }} | |
# path: comtypes/gen | |
- name: Report coverage | |
run: | | |
python -m coverage report | |
python -m coverage html | |
# - name: Zip gen directory | |
# run: | | |
# python -m zipfile -c gen.zip comtypes/gen/ | |
- name: Zip htmlcov directory | |
run: | | |
python -m zipfile -c htmlcov.zip htmlcov/ | |
- name: Commit | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
branch: ${{ github.head_ref }} | |
# file_pattern: "gen.zip htmlcov.zip" | |
file_pattern: "htmlcov.zip" | |
commit_message: add `zip` | |
commit_user_name: github-actions[bot] | |
commit_user_email: 41898282+github-actions[bot]@users.noreply.github.com | |
commit_author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | |
# - name: Upload Coverage info | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: coverage-${{matrix.python-version}}-${{matrix.architecture}}-${{matrix.npsupport}} | |
# path: .coverage | |
- name: Unregister the OutProc COM server | |
run: | | |
cd source/CppTestSrv | |
./server.exe /UnregServer | |
# coverage: | |
# runs-on: ubuntu-latest | |
# needs: unit-tests | |
# steps: | |
# - name: Checkout repository | |
# uses: actions/checkout@v4 | |
# - name: Create temporary directory | |
# run: mkdir downloads | |
# - name: Download coverage artifacts | |
# uses: actions/download-artifact@v4 | |
# with: | |
# pattern: coverage-* | |
# merge-multiple: true | |
# - name: Install coverage | |
# run: pip install coverage | |
# - name: Generate coverage report | |
# run: | | |
# coverage combine | |
# coverage report | |
# coverage html | |
# - name: Upload coverage report | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: coverage-report | |
# path: htmlcov/* | |
# install-tests: | |
# runs-on: ${{ matrix.os }} | |
# strategy: | |
# matrix: | |
# os: [windows-latest, windows-2019] | |
# # python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] | |
# python-version: ['3.7', '3.11'] | |
# architecture: ['x86', 'x64'] | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - name: Set up Python | |
# uses: actions/setup-python@v5 | |
# with: | |
# python-version: ${{ matrix.python-version }} | |
# architecture: ${{ matrix.architecture }} | |
# - name: install comtypes | |
# run: | | |
# pip install --upgrade setuptools | |
# python setup.py install | |
# pip uninstall comtypes -y | |
# python test_pip_install.py |