Skip to content

pytest linux

pytest linux #121

Workflow file for this run

name: pytest linux
on: [push, pull_request]
env:
PYTHONPATH: /home/runner/work/sz-sdk-python-abstract/sz-sdk-python-abstract/src
permissions:
contents: read
jobs:
pytest-linux:
name: "pytest OS: ${{ matrix.os }}; Python ${{ matrix.python-version }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
# python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.11"]
steps:
- name: checkout repository
uses: actions/checkout@v4
- name: set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --requirement requirements.txt
python -m pip install psutil pytest pytest-cov pytest-schema
- name: run pytest on tests
run: pytest tests/ --verbose --capture=no --cov=src/senzing_abstract --cov-append
- name: run unittest on examples
run: |
python3 -m unittest \
examples/szconfig/*.py \
examples/szconfigmanager/*.py \
examples/szdiagnostic/*.py \
examples/szengine/*.py \
examples/szproduct/*.py
# - name: Run pytest on examples
# run: pytest examples/ --verbose --capture=no
- name: rename coverage file
env:
COVERAGE_FILE: ".coverage.${{ matrix.python-version }}"
run: |
mv .coverage "$COVERAGE_FILE"
- name: Store coverage file
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.python-version }}
path: .coverage.${{ matrix.python-version }}
coverage:
name: coverage
needs: pytest-linux
permissions:
pull-requests: write
contents: write
uses: senzing-factory/build-resources/.github/workflows/python-coverage-comment.yaml@v2