Update issue templates #445
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 action | |
| on: | |
| pull_request: | |
| # Run on merge to main because caches are inherited from parent branches | |
| push: | |
| branches: | |
| - main | |
| env: | |
| # This should be the default but we'll be explicit | |
| PRE_COMMIT_HOME: ~/.caches/pre-commit | |
| PYTHON_VERSION: "3.9" | |
| jobs: | |
| the_job: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: Bootstrap poetry | |
| shell: bash | |
| run: | | |
| python -m ensurepip | |
| python -m pip install --upgrade pip | |
| python -m pip install poetry | |
| - name: Configure poetry | |
| shell: bash | |
| run: | | |
| python -m poetry config virtualenvs.in-project true | |
| # - name: Cache Poetry dependencies uses: actions/cache@v3 | |
| # id: poetry-cache | |
| # with: | |
| # path: .venv | |
| # key: venv-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('poetry.lock') }} | |
| - name: Install dependencies | |
| shell: bash | |
| if: steps.poetry-cache.outputs.cache-hit != 'true' | |
| run: | | |
| python -m poetry install --all-extras | |
| - name: Install Pre-Commit | |
| shell: bash | |
| run: | | |
| python -m pip install pre-commit | |
| # - name: Cache Pre-Commit Hooks | |
| # idna: pre-commit-cache | |
| # usnaes: actions/cache@v3 | |
| # winath: | |
| # napath: ${{ env.PRE_COMMIT_HOME }} | |
| # nakey: hooks-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('poetry.lock') }} | |
| - name: Install Pre-Commit Hooks | |
| shell: bash | |
| if: steps.pre-commit-cache.outputs.cache-hit != 'true' | |
| run: | | |
| pre-commit install-hooks | |
| - name: Run Pre-Commit Hooks | |
| shell: bash | |
| run: | | |
| pre-commit run --all-files |