Skip to content

Commit

Permalink
#14001: Run pre-commit on PRs so CMake formatting (and others) are ch…
Browse files Browse the repository at this point in the history
…ecked (#14157)

Black is stubbed out because that's a required check on the branch and GitHub is erroring out when I try to remove it from Required.  To be removed + Pre-commit marked as Required in its place.
  • Loading branch information
afuller-TT authored Oct 26, 2024
1 parent 82b97e5 commit ada4ad8
Showing 1 changed file with 32 additions and 5 deletions.
37 changes: 32 additions & 5 deletions .github/workflows/all-static-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,38 @@ on:
- "main"

jobs:
pre-commit:
name: Run Pre-commit Hooks
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history so 'origin/main' is available
fetch-refs: true # Ensure all refs are fetched

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11

- name: Run Pre-commit
uses: pre-commit/action@v3.0.1
with:
extra_args: |
--from-ref ${{ github.event_name == 'pull_request' && format('refs/remotes/origin/{0}', github.event.pull_request.base.ref) || 'HEAD^' }} \
--to-ref HEAD
continue-on-error: false
check-black:
runs-on: ubuntu-latest
steps:
- name: Do Nothing
run: echo "Black is covered by pre-commit. This is a placeholder to be removed after updating branch restrictions."


check-spdx-licenses:
runs-on: ubuntu-latest
steps:
Expand All @@ -27,11 +59,6 @@ jobs:
- uses: actions/checkout@v4
- name: Check kernel count in base metal is less than maximum
run: if (( $(find tt_metal/kernels/ -type f | wc -l) > 7 )); then exit 1; fi
check-black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: psf/black@23.10.1
check-doc:
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit ada4ad8

Please sign in to comment.