Skip to content

Fix github workflow bug #21

Fix github workflow bug

Fix github workflow bug #21

Workflow file for this run

name: Github workflows
on:
push:
pull_request:
branches: [ "main" ]
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 black radon mypy bandit pytest pytest-cov
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Check code format with black
run: |
black --check . || echo 'Warning: Code is not formatted according to black standards'
black .
- name: Check code complexity with radon
run: |
radon cc . -e "*/test/*" -nc || echo 'Warning: High code complexity detected'
- name: Type check with mypy
run: |
mypy . || echo 'Warning: Type check failed'
- name: Security check with bandit
run: |
bandit -r . || echo 'Warning: Security check failed'
- name: Commit and push changes
run: |
git config --global user.name 'github-actions[bot]' || true
git config --global user.email 'github-actions[bot]@users.noreply.github.com' || true
git add . || true
git commit -m 'Auto format code with black' || echo 'Warning: Nothing to commit'
git push || true