Skip to content

Commit

Permalink
added pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
cpelley committed Jun 7, 2024
1 parent 55d75cb commit 494c11f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
29 changes: 28 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ jobs:
runs-on: ubuntu-latest

steps:
# SETUP

- name: Checkout code
uses: actions/checkout@v4
with:
Expand All @@ -25,12 +27,37 @@ jobs:

- name: Install dependencies
run: |
pip install .[tests,docs]
pip install .[tests,dev]
pip uninstall dagrunner -y
# TESTS

- name: Run pytest
run: pytest

# PRE-COMMIT

- name: Python interpreter version sha (PYSHA)
run: echo "PYSHA=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV

- name: Cache pre-commit
uses: actions/cache@v3
id: pre-commit-cache
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PYSHA }}|${{ hashFiles('.pre-commit-config.yaml') }}

- name: pre-commit install
if: steps.pre-commit-cache.outputs.cache-hit != 'true'
run: |
pre-commit install
- name: pre-commit run
run: |
pre-commit run --all-files
# DOCUMENTATION

- name: Build documentation
run: |
./docs/gen_docs dagrunner ./docs
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ dependencies = [

[project.optional-dependencies]
tests = [
"pytest"
"pytest"
]
dev = [
"pre-commit"
]

[project.urls]
Expand Down

0 comments on commit 494c11f

Please sign in to comment.