Skip to content

Merge pull request #10 from mmlouamri/fix-vn #101

Merge pull request #10 from mmlouamri/fix-vn

Merge pull request #10 from mmlouamri/fix-vn #101

Workflow file for this run

name: Build, lint and test package
on:
push:
branches:
- 'main'
pull_request:
env:
SRC_DIR: cryptomite
TEST_DIR: test
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.8, 3.9, "3.10" ]
outputs:
error-check: ${{ steps.error-check.conclusion }}
steps:
- uses: actions/checkout@v3
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install linter
run: python -m pip install flake8 flake8-broken-line flake8-bugbear flake8-copyright flake8-import-order flake8-quotes
- name: Check for errors
id: error-check
run:
# stop the build if there are Python syntax errors or undefined names
flake8 ${{ env.SRC_DIR }} --count --isolated --select=E9,F63,F7,F82 --show-source --statistics
- name: Lint with flake8
run:
flake8 ${{ env.SRC_DIR }} --max-doc-length=74
- name: Check doc line lengths and complexity
run:
# exit-zero treats all errors as warnings
flake8 ${{ env.SRC_DIR }} --count --exit-zero --isolated --max-complexity=10 --max-doc-length=72 --select=C901,W505 --statistics
- name: Install package
run: pip install .
- name: Install test requirements
run: pip install -r test/requirements.txt
- name: Test package
run: |
pip install pytest
pytest ${{ env.TEST_DIR }}