diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..5b51fdf --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,24 @@ +name: coverage + +on: + push: + branches: [ "master" ] + +jobs: + build: + runs-on: macos-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.11 + uses: actions/setup-python@v3 + with: + python-version: "3.11" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + pip install coverage + - name: Run tests and print coverage report + run: | + coverage run -m pytest + coverage report diff --git a/.github/workflows/flake8_pytest_coverage.yml b/.github/workflows/flake8.yml similarity index 67% rename from .github/workflows/flake8_pytest_coverage.yml rename to .github/workflows/flake8.yml index a04b46f..969dc9b 100644 --- a/.github/workflows/flake8_pytest_coverage.yml +++ b/.github/workflows/flake8.yml @@ -1,7 +1,4 @@ -# This workflow will install Python dependencies, run tests and lint with a single version of Python -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python - -name: Flake8 + pytest&coverage +name: Flake8 on: push: @@ -21,14 +18,9 @@ jobs: python -m pip install --upgrade pip pip install flake8 pytest if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - pip install coverage - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Run tests and print coverage report - run: | - coverage run -m pytest - coverage report diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 9385654..a0b533e 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -1,4 +1,4 @@ -name: Linters +name: mypy on: [push] @@ -18,11 +18,7 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt - pip install pylint pip install mypy - - name: Analysing the code with pylint - run: | - pylint $(git ls-files '*.py') - name: Analyse the code with mypy run: | mypy $(git ls-files '*.py') diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml new file mode 100644 index 0000000..34770d2 --- /dev/null +++ b/.github/workflows/pylint.yml @@ -0,0 +1,24 @@ +name: pylint + +on: [push] + +jobs: + build: + runs-on: macos-latest + strategy: + matrix: + python-version: ["3.11"] + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install pylint + - name: Analysing the code with pylint + run: | + pylint $(git ls-files '*.py')