Skip to content

Commit

Permalink
switch to pre-commit action
Browse files Browse the repository at this point in the history
  • Loading branch information
leej3 committed Jun 20, 2024
1 parent bbf5c2e commit 97db917
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,12 @@ env:
CACHE_NUM: 2

jobs:
run-pre-commit:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Set CACHE_DIR (hard-coded in cache action)
run: echo "CACHE_DIR=$(echo ~/.pre_commit_cache)" >> $GITHUB_ENV
- uses: actions/checkout@main

- uses: actions/cache@v2
with:
path: ~/.pre_commit_cache
key: pre-commit|${{ hashFiles('.pre-commit-config.yaml') }}|${{ env.CACHE_NUM }}

- name: Install and run pre-commit hooks
run: |
export PIP_CACHE_DIR="${CACHE_DIR}/pip"
export PRE_COMMIT_HOME="${CACHE_DIR}/pre-commit"
pip install pre-commit
pre-commit install
pre-commit run --all
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/[email protected]

test:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 97db917

Please sign in to comment.