diff --git a/.github/workflows/tests.yml b/.github/workflows/ci.yml similarity index 74% rename from .github/workflows/tests.yml rename to .github/workflows/ci.yml index e953869..6346021 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Tests +name: CI on: [push] @@ -7,9 +7,43 @@ permissions: pull-requests: write jobs: + lint: + name: Lint & Type Check + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.13", "3.12"] + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install mypy pylint + + - name: Type checking with mypy + run: | + mypy src/ --ignore-missing-imports || echo "mypy check completed with warnings" + + - name: Lint source code with pylint + run: | + pylint $(git ls-files 'src/*.py') + + - name: Lint tests with pylint + run: | + pylint --rcfile=tests/.pylintrc $(git ls-files 'tests/*.py') + unit-tests: name: Unit Tests runs-on: ubuntu-latest + needs: lint strategy: matrix: python-version: ["3.13", "3.12"] @@ -92,6 +126,7 @@ jobs: performance-tests: name: Performance Tests runs-on: ubuntu-latest + needs: unit-tests if: github.event_name == 'pull_request' steps: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d564212..d260e3c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -26,21 +26,3 @@ repos: hooks: - id: flake8 args: ["--max-line-length=88", "--extend-ignore=E203,W503"] - - - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.13.0 - hooks: - - id: mypy - additional_dependencies: [types-requests, types-redis, types-tzlocal] - - - repo: https://github.com/pycqa/pylint - rev: v3.3.2 - hooks: - - id: pylint - name: pylint (source code) - args: ["--rcfile=.pylintrc", "--disable=import-error,no-name-in-module"] - exclude: ^tests/ - - id: pylint - name: pylint (tests) - args: ["--rcfile=tests/.pylintrc", "--disable=import-error,no-name-in-module"] - files: ^tests/