fix workflow commit path #598
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: Pre-commit checks | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - '.github/workflows/**' | |
| - 'mldaikon/**' | |
| - 'tests/**' | |
| pull_request: | |
| paths: | |
| - '.github/workflows/**' | |
| - 'mldaikon/**' | |
| - 'tests/**' | |
| jobs: | |
| pre-commit: | |
| runs-on: self-hosted | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' # Specify your Python version here | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install black==24.3.0 | |
| pip install mypy==1.9.0 | |
| pip install isort | |
| pip install ruff==0.3.3 | |
| pip install torch | |
| pip install polars | |
| pip install tqdm | |
| pip install bytecode | |
| pip install deepdiff | |
| - name: Run black | |
| id: black | |
| run: black --check mldaikon --exclude tests | |
| - name: Run mypy on main source code folder | |
| id: mypy | |
| run: mypy mldaikon --install-types --non-interactive --ignore-missing-imports | |
| - name: Run isort | |
| id: isort | |
| run: isort --check --profile=black mldaikon --skip tests | |
| - name: Run ruff | |
| id: ruff | |
| run: ruff check mldaikon | |
| - name: Check if any checks failed | |
| if: failure() | |
| run: echo "Some pre-commit checks have failed. Please run 'pre-commit run --all-files' locally and fix the issues." | |
| - name: Set job status | |
| if: failure() | |
| run: exit 1 |