-
Notifications
You must be signed in to change notification settings - Fork 8
38 lines (36 loc) · 1.04 KB
/
test-pre-coomit-hook.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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