Skip to content

Bump coverage from 7.6.10 to 7.6.11 #229

Bump coverage from 7.6.10 to 7.6.11

Bump coverage from 7.6.10 to 7.6.11 #229

Workflow file for this run

name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build-linux:
runs-on: ubuntu-latest
env:
PYTHON_COVERAGE_FILE: coverage-data.python
NATIVE_COVERAGE_FILE: coverage-data.native
strategy:
fail-fast: false
matrix:
# If the list of python versions is changed, please make sure that
# `after_n_builds` flag in codecov.yml is updated accordingly
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "pypy3.9", "pypy3.10"]
steps:
- name: Checkout the code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: recursive
- name: Set up Python ${{matrix.python-version}}
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
allow-prereleases: true
python-version: ${{matrix.python-version}}
- name: Install dependencies for Python 3.8
if: ${{matrix.python-version}} == '3.8'
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-3.8.locked
- name: Install dependencies for Python
if: ${{matrix.python-version}} != '3.8'
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- name: Lint with pylint the code of the package
run: |
pylint --max-line-length=120 --disable=E0401,E0611,W0621,W0622 "*.py" "pyitt/*.py"
- name: Lint with pylint the code of tests and samples
run: |
pylint --max-line-length=120 --disable=E0401,E0611,C0114,C0115,C0116,R0801,R0903,R0904,R0913,R0917 "tests/*/*.py" "samples/*.py"
- name: Lint with flake8
run: |
flake8 . --count --per-file-ignores="__init__.py:F401" --max-complexity=10 --max-line-length=120 --statistics --exclude ittapi
- name: Build package
run: |
python -m build
- name: Run unit tests for Python code
run: |
coverage run --data-file=${{env.PYTHON_COVERAGE_FILE}} -m unittest discover -s tests/unit -t .
- name: Generate XML code coverage report for python code
run: |
coverage xml --data-file=${{env.PYTHON_COVERAGE_FILE}} -o ${{env.PYTHON_COVERAGE_FILE}}.xml
- name: Upload coverage report for python code to Codecov
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
with:
files: ${{env.PYTHON_COVERAGE_FILE}}.xml
flags: unittests
token: ${{secrets.CODECOV_TOKEN}}
- name: Build package with code coverage for native part and install it for integration testing
env:
PYITT_NATIVE_BUILD_WITH_CODE_COVERAGE: 1
run: |
python -m pip install .
- name: Run integration tests
env:
COVERAGE_RCFILE: ../.coveragerc.integration
working-directory: tests
run: |
coverage run --data-file=${{env.PYTHON_COVERAGE_FILE}} -m unittest discover -s integration -t .
- name: Generate XML code coverage report for python code
env:
COVERAGE_RCFILE: .coveragerc.integration
run: |
coverage xml --data-file=tests/${{env.PYTHON_COVERAGE_FILE}} -o ${{env.PYTHON_COVERAGE_FILE}}.xml
- name: Generate LCOV code coverage report for native code
run: |
gcovr --filter pyitt.native/ --lcov ${{env.NATIVE_COVERAGE_FILE}}.lcov
- name: Upload coverage report for native code to Codecov
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
with:
files: ${{env.NATIVE_COVERAGE_FILE}}.lcov,${{env.PYTHON_COVERAGE_FILE}}.xml
flags: integration
token: ${{secrets.CODECOV_TOKEN}}
build-windows:
runs-on: windows-latest
env:
PYTHON_COVERAGE_FILE: coverage-data.python
strategy:
fail-fast: false
matrix:
# If the list of python versions is changed, please make sure that
# `after_n_builds` flag in codecov.yml is updated accordingly
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "pypy3.9", "pypy3.10"]
steps:
- name: Checkout the code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: recursive
- name: Install MSVC
uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2
- name: Set up Python ${{matrix.python-version}}
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
allow-prereleases: true
python-version: ${{matrix.python-version}}
- name: Install dependencies for Python 3.8
if: ${{matrix.python-version}} == '3.8'
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-3.8.locked
- name: Install dependencies for Python
if: ${{matrix.python-version}} != '3.8'
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- name: Lint with pylint the code of the package
run: |
pylint --max-line-length=120 --disable=E0401,E0611,W0621,W0622 "*.py" "pyitt/*.py"
- name: Lint with pylint the code of tests and samples
run: |
pylint --max-line-length=120 --disable=E0401,E0611,C0114,C0115,C0116,R0801,R0903,R0904,R0913,R0917 "tests/*/*.py" "samples/*.py"
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --per-file-ignores="__init__.py:F401" --max-complexity=10 --max-line-length=120 --statistics --exclude ittapi
- name: Build package
run: |
python -m build
- name: Run unit tests for Python code
run: |
coverage run --data-file=${{env.PYTHON_COVERAGE_FILE}} -m unittest discover -s tests/unit -t .
- name: Generate XML code coverage report for python code
run: |
coverage xml --data-file=${{env.PYTHON_COVERAGE_FILE}} -o ${{env.PYTHON_COVERAGE_FILE}}.xml
- name: Upload coverage report for python code to Codecov
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
with:
files: ./${{env.PYTHON_COVERAGE_FILE}}.xml
flags: unittests
token: ${{secrets.CODECOV_TOKEN}}
- name: Build package for native part and install it for integration testing
run: |
python -m pip install .
- name: Run integration tests
env:
COVERAGE_RCFILE: ../.coveragerc.integration
working-directory: tests
run: |
coverage run --data-file=${{env.PYTHON_COVERAGE_FILE}} -m unittest discover -s integration -t .
- name: Generate XML code coverage report for python code
env:
COVERAGE_RCFILE: .coveragerc.integration
run: |
coverage xml --data-file=tests/${{env.PYTHON_COVERAGE_FILE}} -o ${{env.PYTHON_COVERAGE_FILE}}.xml
- name: Upload coverage report for python code to Codecov
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
with:
files: ${{env.PYTHON_COVERAGE_FILE}}.xml
flags: integration
token: ${{secrets.CODECOV_TOKEN}}