Skip to content

Commit

Permalink
reorganized the gh action workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
wegar-2 committed Feb 19, 2024
1 parent 5f6797b commit 6926962
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 14 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
6 changes: 1 addition & 5 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Linters
name: mypy

on: [push]

Expand All @@ -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')
24 changes: 24 additions & 0 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
@@ -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')

0 comments on commit 6926962

Please sign in to comment.