chore: added pre-commit hooks commitlint, black, flake8 #177
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: Drools JPY Package | |
on: | |
push: | |
branches: [ 'main' ] | |
pull_request: | |
branches: [ 'main' ] | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [ "3.8", "3.9", "3.10", "3.11" ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: '18' | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Upgrade pip | |
run: | | |
python3 -m pip install --upgrade pip | |
python3 -m pip install --upgrade build | |
python3 -m pip install .[tests] .[dev] | |
- name: Run flake8 | |
run: flake8 . | |
- name: Run formatter | |
run: black --check . | |
- name: Run isort | |
run: isort --check . | |
- name: Run commitlint | |
uses: wagoid/commitlint-github-action@v5 | |
- name: Install package | |
run: python3 -m build | |
- name: Run tox | |
run: tox | |
- name: Run coverage | |
run: pytest --cov=./ --cov-report=xml | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
env_vars: OS,PYTHON | |
fail_ci_if_error: false | |
files: ./coverage.xml | |
flags: unittests | |
name: codecov-umbrella | |
verbose: true |