Skip to content

⬆️ UPGRADE: Autoupdate pre-commit config #747

⬆️ UPGRADE: Autoupdate pre-commit config

⬆️ UPGRADE: Autoupdate pre-commit config #747

name: Test pre-commit Hook
on:
push:
tags:
- v**
branches-ignore:
- "dependabot/**"
- "sourcery/**"
- "create-pr-action/pre-commit-config-update-*"
pull_request:
workflow_dispatch:
jobs:
test-pre-commit-hook:
name: Test pre-commit hook
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.7
- uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit-hook-test-${{ hashFiles('requirements_dev.txt') }}
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U -r requirements_dev.txt
pip install .
- name: Run flake8-nb
run: flake8-nb tests/data/notebooks/ 2>&1 | tee flake8-nb_run_output.txt
- name: Run hook
run: pre-commit try-repo . -a 2>&1 | tee hook_run_output.txt
- name: Test hook output
run: pytest .github/hook_tester.py