use pytest and add coverage threshold #25
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
name: Verify buildability | |
on: | |
push: | |
paths: | |
- pyproject.toml | |
- patchmatch | |
- github/workflows/verify-buildability.yml | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
pre-commit-check: | |
runs-on: ubuntu-latest | |
env: | |
PIP_USE_PEP517: '1' | |
steps: | |
- name: Checkout sources | |
id: checkout-sources | |
uses: actions/checkout@v3 | |
- name: setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
cache: pip | |
cache-dependency-path: pyproject.toml | |
- name: install dev dependencies | |
run: pip3 install ".[dev]" | |
- name: run pre-commit-check | |
run: > | |
pre-commit run | |
--all-files | |
--show-diff-on-failure | |
build: | |
if: github.event.pull_request.draft == false | |
strategy: | |
matrix: | |
python-version: | |
- '3.9' | |
- '3.10' | |
os: | |
- windows-latest | |
- ubuntu-latest | |
- macos-latest | |
fail-fast: false | |
name: ${{ matrix.python-version }} on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
env: | |
PIP_USE_PEP517: '1' | |
steps: | |
- name: Checkout sources | |
id: checkout-sources | |
uses: actions/checkout@v3 | |
- name: linux prerequisites | |
if: runner.os == 'linux' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libopencv-dev | |
- name: macos prerequisites | |
if: runner.os == 'macos' | |
run: brew install opencv | |
- name: setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: pip | |
cache-dependency-path: pyproject.toml | |
- name: install PyPatchMatch | |
run: pip3 install --upgrade . | |
- name: run py_example.py | |
run: python3 examples/py_example.py |