Skip to content

Commit

Permalink
Merge pull request #2 from euro-hpc-pl/kj/github-actions
Browse files Browse the repository at this point in the history
Add Github actions for quality checks
  • Loading branch information
lpawela authored Aug 27, 2021
2 parents 2cc998f + e86e7f6 commit 355e066
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 3 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/build_and_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Build package

on:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install pypa/build
run: python -m pip install build --user
- name: Build binary wheel and source tarball
run: python -m build --sdist --wheel --outdir dist/
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_TOKEN }}
49 changes: 49 additions & 0 deletions .github/workflows/quality_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Run tests and other quality checks

on: [pull_request]

jobs:
run_tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-versions: [3.9]
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies and the package
run: |
python -m pip install --upgrade pip
pip install .[test]
- name: Run unit tests
run: pytest --cov=omnisolver --cov-report=xml
- name: Report coverage
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
fail_ci_if_error: true

run_quality_cheks:
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- uses: actions/checkout@v2
- name: Run quality checks
uses: ricardochaves/python-lint@v1.4.0
with:
python-root-list: "omnisolver"
use-pylint: false
use-pycodestyle: false
use-flake8: true
use-mypy: true
use-black: true
use-isort: true
extra-flake8-options: --max-line-length=100
extra-mypy-options: --ignore-missing-imports --namespace-packages
extra-isort-options: --check-only --profile black
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[tool.black]
line-length = 100
target-version = ['py36', 'py37', 'py38', 'py39']
include = '\.pyi?$'
exclude = '''
/(
Expand Down
7 changes: 5 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ classifiers =

[options]
packages = find_namespace:
python_requires = >= 3.9
python_requires = >= 3.7
install_requires =
dimod >= 0.9.10
numpy >= 1.19.4
Expand All @@ -25,7 +25,7 @@ install_requires =
pandas >= 1.1.4

[options.extras_require]
test = pytest>=6.1.2; pytest-mock>=3.3.1
test = pytest>=6.1.2; pytest-mock>=3.3.1; pytest-cov>=2.12.1

[options.entry_points]
console_scripts =
Expand All @@ -35,3 +35,6 @@ omnisolver =

[options.packages.find]
exclude = tests

[coverage:run]
relative_files = True

0 comments on commit 355e066

Please sign in to comment.