chore: replace isort with ruff (#57) #207
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: Run Checks | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| test: | |
| strategy: | |
| matrix: | |
| python: [ "3.8", "3.9", "3.10", "3.11", "3.12" ] | |
| os: [ ubuntu-latest, macos-latest, windows-latest ] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| - name: Get Python Version | |
| id: get_python_version | |
| run: echo "::set-output name=python_version::$(python --version)" | |
| - name: Cache dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: .venv | |
| key: ${{ runner.os }}-${{ steps.get_python_version.outputs.python_version }}-dependencies-${{ hashFiles('**/poetry.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ steps.get_python_version.outputs.python_version }}-dependencies | |
| - name: Install Poetry | |
| run: pip install poetry poetry-plugin-export | |
| - name: Create Virtual Environment | |
| run: python -m venv .venv | |
| - name: Upgrade pip | |
| run: poetry run python -m pip install --upgrade pip | |
| - name: Install Dependencies | |
| run: poetry install | |
| - name: Run Black | |
| run: poetry run task black --check | |
| - name: Run safety | |
| run: poetry export -f requirements.txt | poetry run safety check --bare --stdin | |
| - name: Run mypy | |
| run: poetry run task mypy | |
| - name: Run ruff | |
| run: poetry run task ruff | |
| - name: Run pytest | |
| run: poetry run task test | |
| env: | |
| TASKIPY: true |