Release v1.2.1 #457
Workflow file for this run
This file contains 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: Formatter | |
on: | |
pull_request: | |
jobs: | |
check-changes: | |
name: Check Changes | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Check Changes | |
uses: dorny/paths-filter@v2 | |
id: changes | |
with: | |
filters: | | |
python-files: | |
- '**.py,**.pyi,**.ipynb' | |
formatter: | |
name: Format | |
needs: check-changes | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Install Node Packages | |
uses: ./.github/actions/install-node-packages | |
- name: Install Python Modules | |
uses: ./.github/actions/install-python-modules | |
- name: Run Prettier | |
run: npx prettier --write . | |
- name: Run Databooks | |
if: needs.changes.outputs.python-files == 'true' | |
run: poetry run databooks meta --rm-outs --rm-exec --yes . | |
- name: Run nqQA isort | |
if: needs.changes.outputs.python-files == 'true' | |
run: poetry run nbqa isort . | |
- name: Run nqQA pyupgrade | |
if: needs.changes.outputs.python-files == 'true' | |
run: poetry run nbqa pyupgrade . | |
- name: Run Black | |
if: needs.changes.outputs.python-files == 'true' | |
run: poetry run black . | |
- name: Cache pre-commit | |
uses: actions/cache@v3 | |
id: precommit_cache_id | |
with: | |
path: ~/.cache/pre-commit | |
key: pre-commit-cache-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('.pre-commit-config.yaml') }} | |
- name: Run pre-commit | |
if: steps.precommit_cache_id.outputs.cache-hit != 'true' | |
run: poetry run pre-commit run --all-files | |
- name: Commit | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Formatted! |