-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#14001: Run pre-commit on PRs so CMake formatting (and others) are ch…
…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
1 parent
82b97e5
commit ada4ad8
Showing
1 changed file
with
32 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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/[email protected] | ||
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: | ||
|
@@ -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/[email protected] | ||
check-doc: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|