зеркало из
https://github.com/ssciwr/AMMICO.git
synced 2025-10-29 13:06:04 +02:00
Create ci.yml (#29)
* Create ci.yml * include pytest * Update pyproject.toml * include pytest-cov * use approx in pytest * Update test_faces.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add coverage yaml * reduce passing grade Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Этот коммит содержится в:
родитель
1f8166e731
Коммит
2dd1a7952f
39
.github/workflows/ci.yml
поставляемый
Обычный файл
39
.github/workflows/ci.yml
поставляемый
Обычный файл
@ -0,0 +1,39 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ main ]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-20.04]
|
||||||
|
python-version: [3.9]
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
|
uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
python -m pip install .
|
||||||
|
- name: Run pytest
|
||||||
|
run: |
|
||||||
|
cd misinformation
|
||||||
|
python -m pytest -s --cov=. --cov-report=xml
|
||||||
|
- name: Upload coverage
|
||||||
|
uses: codecov/codecov-action@v1
|
||||||
|
with:
|
||||||
|
fail_ci_if_error: true
|
||||||
|
files: misinformation/coverage.xml
|
||||||
11
codecov.yml
Обычный файл
11
codecov.yml
Обычный файл
@ -0,0 +1,11 @@
|
|||||||
|
codecov:
|
||||||
|
require_ci_to_pass: yes
|
||||||
|
|
||||||
|
coverage:
|
||||||
|
status:
|
||||||
|
project:
|
||||||
|
default:
|
||||||
|
target: 0
|
||||||
|
patch:
|
||||||
|
default:
|
||||||
|
target: 80
|
||||||
@ -1,5 +1,6 @@
|
|||||||
import misinformation.faces as fc
|
import misinformation.faces as fc
|
||||||
import json
|
import json
|
||||||
|
from pytest import approx
|
||||||
|
|
||||||
|
|
||||||
def test_analyse_faces():
|
def test_analyse_faces():
|
||||||
@ -22,4 +23,4 @@ def test_analyse_faces():
|
|||||||
if type(mydict["emotion"][i]) == tuple
|
if type(mydict["emotion"][i]) == tuple
|
||||||
else mydict["emotion"][i]
|
else mydict["emotion"][i]
|
||||||
)
|
)
|
||||||
assert temp == out_dict["emotion"][i]
|
assert approx(temp) == out_dict["emotion"][i]
|
||||||
|
|||||||
@ -35,10 +35,12 @@ dependencies = [
|
|||||||
"tensorflow",
|
"tensorflow",
|
||||||
"keras",
|
"keras",
|
||||||
"openpyxl",
|
"openpyxl",
|
||||||
|
"pytest",
|
||||||
|
"pytest-cov",
|
||||||
]
|
]
|
||||||
|
|
||||||
[project.scripts]
|
[project.scripts]
|
||||||
misinformation_prefetch_models = "misinformation.utils:misinformation_prefetch_models"
|
misinformation_prefetch_models = "misinformation.utils:misinformation_prefetch_models"
|
||||||
|
|
||||||
[tool.setuptools]
|
[tool.setuptools]
|
||||||
packages = ["misinformation"]
|
packages = ["misinformation"]
|
||||||
|
|||||||
@ -11,4 +11,6 @@ retina_face
|
|||||||
setuptools
|
setuptools
|
||||||
tensorflow
|
tensorflow
|
||||||
keras
|
keras
|
||||||
openpyxl
|
openpyxl
|
||||||
|
pytest
|
||||||
|
pytest-cov
|
||||||
|
|||||||
Загрузка…
x
Ссылка в новой задаче
Block a user