Skip to content

⬆️(deps)(deps): Update requests requirement from >=2.25.0 to >=2.32.5 #495

⬆️(deps)(deps): Update requests requirement from >=2.25.0 to >=2.32.5

⬆️(deps)(deps): Update requests requirement from >=2.25.0 to >=2.32.5 #495

Workflow file for this run

name: CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
test:
name: Test Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install -r requirements-dev.txt
- name: Lint with flake8
run: |
# Stop the build if there are Python syntax errors or undefined names
flake8 refactron --count --select=E9,F63,F7,F82 --show-source --statistics
# Exit-zero treats all errors as warnings
flake8 refactron --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Run tests with pytest
run: |
pytest --cov=refactron --cov-report=xml --cov-report=term
- name: Upload coverage to Codecov
if: matrix.python-version == '3.11'
uses: codecov/codecov-action@v5
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
code-quality:
name: Code Quality Checks
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.11"
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black==24.10.0 isort mypy
- name: Check formatting with Black
run: |
black --check --line-length=100 refactron tests
- name: Check import sorting with isort
run: |
isort --check-only --profile black --line-length=100 refactron tests
security:
name: Security Scan
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Run Bandit security scan
run: |
pip install bandit
bandit -r refactron -f json -o bandit-report.json || true
- name: Upload Bandit report
if: always()
uses: actions/upload-artifact@v6
with:
name: bandit-security-report
path: bandit-report.json
build:
name: Build Distribution
runs-on: ubuntu-latest
needs: [test, code-quality]
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Install build tools
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build package
run: |
python -m build
- name: Check package with twine
run: |
twine check dist/*
- name: Upload distribution artifacts
uses: actions/upload-artifact@v6
with:
name: dist-packages
path: dist/
integration-test:
name: Integration Tests
runs-on: ubuntu-latest
needs: [test]
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Install package
run: |
python -m pip install --upgrade pip
pip install -e .
- name: Test CLI version and help
run: |
refactron --version
refactron --help
- name: Test analyze command
run: |
refactron analyze examples/simple_clean_example.py
echo "✅ Analyze command executed successfully"
- name: Test refactor command (preview mode)
run: |
refactron refactor examples/simple_clean_example.py --preview
echo "✅ Refactor command executed successfully"
- name: Test analyze on intentionally bad code (should find issues)
run: |
# This should find issues but we don't want to fail the build
refactron analyze examples/bad_code_example.py || echo "✅ Found issues as expected"
- name: Test init command
run: |
cd /tmp
refactron init
test -f .refactron.yaml && echo "✅ Config file created"
- name: Test Python API
run: |
python -c "
from refactron import Refactron
from refactron.core.config import RefactronConfig
config = RefactronConfig.default()
r = Refactron(config)
print('✅ Python API import successful')
"