Format code with black and isort for CI compliance #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tests | |
| on: | |
| push: | |
| branches: [main, dev] | |
| pull_request: | |
| branches: [main, dev] | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| cache: "pip" | |
| - name: Install linting tools | |
| run: | | |
| pip install --upgrade pip | |
| pip install flake8 black isort | |
| - name: Run flake8 | |
| run: flake8 sushie/ tests/ --max-line-length=120 --extend-ignore=E203,W503 | |
| - name: Check black formatting | |
| run: black --check --line-length=120 sushie/ tests/ | |
| - name: Check isort | |
| run: isort --check-only --profile black sushie/ tests/ | |
| test: | |
| name: Test Python ${{ matrix.python-version }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.9", "3.10", "3.11"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: "pip" | |
| - name: Install dependencies | |
| run: | | |
| pip install --upgrade pip | |
| pip install -r requirements.txt -r requirements_dev.txt | |
| pip install -e .[testing] | |
| - name: Run tests with coverage | |
| run: pytest tests/ --cov=sushie --cov-report=xml --cov-report=term-missing -v | |
| - name: Upload coverage to Codecov | |
| if: matrix.python-version == '3.10' | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: ./coverage.xml | |
| fail_ci_if_error: false | |
| verbose: true | |
| typecheck: | |
| name: Type Check | |
| runs-on: ubuntu-latest | |
| continue-on-error: true # Don't fail the build on type errors (informational only) | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| cache: "pip" | |
| - name: Install dependencies | |
| run: | | |
| pip install --upgrade pip | |
| pip install -r requirements.txt -r requirements_dev.txt | |
| pip install mypy pandas-stubs types-setuptools | |
| - name: Run mypy | |
| run: mypy sushie/ --ignore-missing-imports || true |