Skip to content

Commit

Permalink
coverage config
Browse files Browse the repository at this point in the history
  • Loading branch information
junkmd committed Jun 25, 2024
1 parent 11d7651 commit c7c7b79
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 24 deletions.
13 changes: 13 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[run]
branch = True
source =
comtypes/
omit =
comtypes/gen/*
comtypes/test/*
relative_files = True

[report]
exclude_also =
if TYPE_CHECKING:
if __name__ == .__main__.:
109 changes: 85 additions & 24 deletions .github/workflows/autotest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ jobs:
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.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
Expand All @@ -32,29 +35,87 @@ jobs:
if ("${{ matrix.npsupport }}" -eq "with npsupport") {
pip install 'numpy<2'
}
python -m unittest discover -v -s ./comtypes/test -t comtypes\test
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
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']
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
# 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

0 comments on commit c7c7b79

Please sign in to comment.